Skip to content
Snippets Groups Projects
Commit ac0bad24 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

remake Host: for each connection and it'll work with proxies too

parent 67d5c0a9
No related branches found
No related tags found
No related merge requests found
......@@ -469,10 +469,14 @@ CURLcode Curl_http(struct connectdata *conn)
http->sendit = Curl_getFormData(data->httppost, &http->postsize);
}
if(!checkheaders(data, "Host:") &&
!conn->allocptr.host) {
/* if ptr_host is already set, it is OK since we only re-use connections
to the very same host and port */
if(!checkheaders(data, "Host:")) {
/* if ptr_host is already set, it is almost OK since we only re-use
connections to the very same host and port, but when we use a HTTP
proxy we have a persistant connect and yet we must change the Host:
header! */
if(conn->allocptr.host)
free(conn->allocptr.host);
if(((conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTPS)) ||
(!(conn->protocol&PROT_HTTPS) && (conn->remote_port == PORT_HTTP)) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment