summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/taler-merchant-httpd_helper.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_helper.c b/src/backend/taler-merchant-httpd_helper.c
index 3e525245..2e06a432 100644
--- a/src/backend/taler-merchant-httpd_helper.c
+++ b/src/backend/taler-merchant-httpd_helper.c
@@ -742,6 +742,7 @@ TMH_base_url_by_connection (struct MHD_Connection *connection,
{
const char *host;
const char *forwarded_host;
+ const char *forwarded_port;
const char *uri_path;
memset (buf,
@@ -773,6 +774,16 @@ TMH_base_url_by_connection (struct MHD_Connection *connection,
GNUNET_buffer_write_str (buf,
host);
}
+ forwarded_port = MHD_lookup_connection_value (connection,
+ MHD_HEADER_KIND,
+ "X-Forwarded-Port");
+ if (NULL != forwarded_port)
+ {
+ GNUNET_buffer_write_str (buf,
+ ":");
+ GNUNET_buffer_write_str (buf,
+ forwarded_port);
+ }
uri_path = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
"X-Forwarded-Prefix");
@@ -799,6 +810,7 @@ TMH_taler_uri_by_connection (struct MHD_Connection *connection,
{
const char *host;
const char *forwarded_host;
+ const char *forwarded_port;
const char *uri_path;
memset (buf,
@@ -810,6 +822,9 @@ TMH_taler_uri_by_connection (struct MHD_Connection *connection,
forwarded_host = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
"X-Forwarded-Host");
+ forwarded_port = MHD_lookup_connection_value (connection,
+ MHD_HEADER_KIND,
+ "X-Forwarded-Port");
uri_path = MHD_lookup_connection_value (connection,
MHD_HEADER_KIND,
"X-Forwarded-Prefix");
@@ -833,6 +848,13 @@ TMH_taler_uri_by_connection (struct MHD_Connection *connection,
"/");
GNUNET_buffer_write_str (buf,
host);
+ if (NULL != forwarded_port)
+ {
+ GNUNET_buffer_write_str (buf,
+ ":");
+ GNUNET_buffer_write_str (buf,
+ forwarded_port);
+ }
if (NULL != uri_path)
GNUNET_buffer_write_path (buf,
uri_path);