exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit dbea8baaff1c84a8bb833fa5e1a4c9d0fb6a4c91
parent 6a373d1e568ad6b5f15c68f94223e9b488044be1
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 21 Aug 2019 18:28:26 +0200

detect plain http server

Diffstat:
Msrc/util/util.c | 25++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/util/util.c b/src/util/util.c @@ -431,10 +431,33 @@ TALER_url_absolute_mhd (struct MHD_Connection *connection, const char *prefix; va_list args; char *result; - + + if (NULL != forwarded_proto) + { proto = forwarded_proto; + } + else + { + /* likely not reverse proxy, figure out if we are + http by asking MHD */ + const union MHD_ConnectionInfo *ci; + ci = MHD_get_connection_info (connection, + MHD_CONNECTION_INFO_DAEMON); + if (NULL != ci) + { + const union MHD_DaemonInfo *di; + + di = MHD_get_daemon_info (ci->daemon, + MHD_DAEMON_INFO_FLAGS); + if (NULL != di) + { + if (0 == (di->flags & MHD_USE_TLS)) + proto = "http"; + } + } + } host = MHD_lookup_connection_value (connection, MHD_HEADER_KIND, "Host"); forwarded_host = MHD_lookup_connection_value (connection, MHD_HEADER_KIND, "X-Forwarded-Host");