mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
Fixes Brian Akins' reported problems with duplicate Host: headers on re-used
connections.
This commit is contained in:
parent
7ca49dc91d
commit
a7bed4fc7c
@ -1351,6 +1351,8 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
}
|
||||
}
|
||||
|
||||
Curl_safefree(conn->allocptr.host);
|
||||
|
||||
ptr = checkheaders(data, "Host:");
|
||||
if(ptr && !data->state.this_is_a_follow) {
|
||||
/* If we have a given custom Host: header, we extract the host name in
|
||||
@ -1374,10 +1376,10 @@ CURLcode Curl_http(struct connectdata *conn)
|
||||
memcpy(conn->allocptr.cookiehost, start, len);
|
||||
conn->allocptr.cookiehost[len]=0;
|
||||
}
|
||||
|
||||
conn->allocptr.host = NULL;
|
||||
}
|
||||
else {
|
||||
Curl_safefree(conn->allocptr.host);
|
||||
|
||||
/* When building Host: headers, we must put the host name within
|
||||
[brackets] if the host name is a plain IPv6-address. RFC2732-style. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user