wget: always print port# in 'Host' header (smaller code)
This commit is contained in:
parent
919c10dd88
commit
a8951cbc34
@ -272,15 +272,8 @@ int wget_main(int argc, char **argv)
|
|||||||
fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path);
|
fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
fprintf(sfp, "Host: %s:%u\r\nUser-Agent: %s\r\n",
|
||||||
const char *portstr = "";
|
target.host, target.port, user_agent);
|
||||||
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 ENABLE_FEATURE_WGET_AUTHENTICATION
|
||||||
if (target.user) {
|
if (target.user) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user