mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
wget: print port# in 'Host' header, if different from 80
This commit is contained in:
parent
562dc249e0
commit
b36b370fbe
@ -272,8 +272,15 @@ int wget_main(int argc, char **argv)
|
||||
fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path);
|
||||
}
|
||||
|
||||
fprintf(sfp, "Host: %s\r\nUser-Agent: %s\r\n", target.host,
|
||||
user_agent);
|
||||
{
|
||||
const char *portstr = "";
|
||||
if (target.port != 80)
|
||||
portstr = xasprintf(":%d", target.port);
|
||||
fprintf(sfp, "Host: %s%s\r\nUser-Agent: %s\r\n",
|
||||
target.host, portstr, user_agent);
|
||||
if (ENABLE_FEATURE_CLEAN_UP && target.port != 80)
|
||||
free((char*)portstr);
|
||||
}
|
||||
|
||||
#if ENABLE_FEATURE_WGET_AUTHENTICATION
|
||||
if (target.user) {
|
||||
|
Loading…
Reference in New Issue
Block a user