http_client: fix wrong host header when using proxy
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
@@ -65,7 +65,11 @@ int flb_http_strip_port_from_host(struct flb_http_client *c)
struct flb_upstream *u = c->u_conn->u;
if (!c->host) {
+ if (!u->proxied_host) {
out_host = u->tcp_host;
+ } else {
+ out_host = u->proxied_host;
+ }
} else {
out_host = (char *) c->host;
}
