diff options
author | Daniel Stenberg <daniel@haxx.se> | 2000-10-20 13:48:38 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2000-10-20 13:48:38 +0000 |
commit | c44b10de41ffca204acf11f36093c24521119239 (patch) | |
tree | c88c03406fc940353868f63b600acafa56366e81 /lib/http.c | |
parent | 135cc036aa1425c52c3cf90176158c19e109cb9b (diff) |
remote_port used in Host: headers only when non-default
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c index 551fac339..1e6bd24b2 100644 --- a/lib/http.c +++ b/lib/http.c @@ -336,7 +336,13 @@ CURLcode http(struct connectdata *conn) } if(!checkheaders(data, "Host:")) { - data->ptr_host = maprintf("Host: %s:%d\r\n", host, data->remote_port); + if(((conn->protocol&PROT_HTTPS) && (data->remote_port == PORT_HTTPS)) || + (!(conn->protocol&PROT_HTTPS) && (data->remote_port == PORT_HTTP)) ) + /* If (HTTPS on port 443) OR (non-HTTPS on port 80) then don't include + the port number in the host string */ + data->ptr_host = maprintf("Host: %s\r\n", host); + else + data->ptr_host = maprintf("Host: %s:%d\r\n", host, data->remote_port); } if(!checkheaders(data, "Pragma:")) |