mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
do not add port number to "Host" header if it was not explicitly passed
This commit is contained in:
parent
76a638a277
commit
72416e3258
@ -186,6 +186,11 @@ http_client_request(struct http_client_ctx *ctx)
|
|||||||
return ctx->ret;
|
return ctx->ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (port <= 0)
|
||||||
|
snprintf(s, PATH_MAX, "%s", hostname);
|
||||||
|
else
|
||||||
|
snprintf(s, PATH_MAX, "%s:%d", hostname, port);
|
||||||
|
|
||||||
if (port <= 0)
|
if (port <= 0)
|
||||||
port = 80;
|
port = 80;
|
||||||
|
|
||||||
@ -231,7 +236,6 @@ http_client_request(struct http_client_ctx *ctx)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
headers = evhttp_request_get_output_headers(req);
|
headers = evhttp_request_get_output_headers(req);
|
||||||
snprintf(s, PATH_MAX, "%s:%d", hostname, port);
|
|
||||||
evhttp_add_header(headers, "Host", s);
|
evhttp_add_header(headers, "Host", s);
|
||||||
evhttp_add_header(headers, "Content-Length", "0");
|
evhttp_add_header(headers, "Content-Length", "0");
|
||||||
evhttp_add_header(headers, "User-Agent", "forked-daapd/" VERSION);
|
evhttp_add_header(headers, "User-Agent", "forked-daapd/" VERSION);
|
||||||
|
Loading…
Reference in New Issue
Block a user