summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2024-05-23 00:39:56 +0300
committerGitHub <noreply@github.com>2024-05-22 21:39:56 +0000
commit271bf8fd10468e18d64f5ac9dca2f9f802f6d239 (patch)
tree39b2cf19dac7145d211037f924e461808868b007
parent9cd6a2459a84e79869d3f9b6fd3f0b1fd0085af9 (diff)
Include the Host in the HTTP header (mqtt) (#17731)
Add Host: header
-rw-r--r--src/aclk/mqtt_websockets/mqtt_wss_client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/aclk/mqtt_websockets/mqtt_wss_client.c b/src/aclk/mqtt_websockets/mqtt_wss_client.c
index a2aef80ceb..bc67ae7f5b 100644
--- a/src/aclk/mqtt_websockets/mqtt_wss_client.c
+++ b/src/aclk/mqtt_websockets/mqtt_wss_client.c
@@ -441,7 +441,8 @@ static int http_proxy_connect(mqtt_wss_client client)
poll_fd.events = POLLIN;
r_buf_ptr = rbuf_get_linear_insert_range(r_buf, &r_buf_linear_insert_capacity);
- snprintf(r_buf_ptr, r_buf_linear_insert_capacity,"%s %s:%d %s" HTTP_ENDLINE, PROXY_CONNECT, client->target_host, client->target_port, PROXY_HTTP);
+ snprintf(r_buf_ptr, r_buf_linear_insert_capacity,"%s %s:%d %s" HTTP_ENDLINE "Host: %s" HTTP_ENDLINE, PROXY_CONNECT,
+ client->target_host, client->target_port, PROXY_HTTP, client->target_host);
write(client->sockfd, r_buf_ptr, strlen(r_buf_ptr));
if (client->proxy_uname) {