Skip to content

Commit 4e0b2ba

Browse files
authored
http_client: fix wrong host header when using proxy (#4816)
When the header isn't the target host but the proxy the AWS signature signing fails in src/flb_signv4.c which will result in the following error message: User is not authorized to perform this action Signed-off-by: Hannes Doyle (marulkan) <[email protected]>
1 parent 71a0233 commit 4e0b2ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/flb_http_client.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ int flb_http_strip_port_from_host(struct flb_http_client *c)
6666
struct flb_upstream *u = c->u_conn->u;
6767

6868
if (!c->host) {
69-
out_host = u->tcp_host;
69+
if (!u->proxied_host) {
70+
out_host = u->tcp_host;
71+
} else {
72+
out_host = u->proxied_host;
73+
}
7074
} else {
7175
out_host = (char *) c->host;
7276
}

0 commit comments

Comments
 (0)