Merge pull request #132 from archivaldo/fronting

small fix to allow fronting
This commit is contained in:
yhirose 2019-03-07 17:56:11 -05:00 committed by GitHub
commit a86f6dfa76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2066,6 +2066,7 @@ inline void Client::write_request(Stream& strm, Request& req)
path.c_str());
// Headers
if (!req.has_header("Host")) {
if (is_ssl()) {
if (port_ == 443) {
req.set_header("Host", host_.c_str());
@ -2079,6 +2080,7 @@ inline void Client::write_request(Stream& strm, Request& req)
req.set_header("Host", host_and_port_.c_str());
}
}
}
if (!req.has_header("Accept")) {
req.set_header("Accept", "*/*");