mirror of
https://github.com/curl/curl.git
synced 2026-08-25 13:13:31 +03:00
remote_port used in Host: headers only when non-default
This commit is contained in:
parent
135cc036aa
commit
c44b10de41
2 changed files with 10 additions and 3 deletions
|
|
@ -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:"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue