mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Merge pull request #132 from archivaldo/fronting
small fix to allow fronting
This commit is contained in:
commit
a86f6dfa76
24
httplib.h
24
httplib.h
@ -2066,17 +2066,19 @@ inline void Client::write_request(Stream& strm, Request& req)
|
|||||||
path.c_str());
|
path.c_str());
|
||||||
|
|
||||||
// Headers
|
// Headers
|
||||||
if (is_ssl()) {
|
if (!req.has_header("Host")) {
|
||||||
if (port_ == 443) {
|
if (is_ssl()) {
|
||||||
req.set_header("Host", host_.c_str());
|
if (port_ == 443) {
|
||||||
} else {
|
req.set_header("Host", host_.c_str());
|
||||||
req.set_header("Host", host_and_port_.c_str());
|
} else {
|
||||||
}
|
req.set_header("Host", host_and_port_.c_str());
|
||||||
} else {
|
}
|
||||||
if (port_ == 80) {
|
} else {
|
||||||
req.set_header("Host", host_.c_str());
|
if (port_ == 80) {
|
||||||
} else {
|
req.set_header("Host", host_.c_str());
|
||||||
req.set_header("Host", host_and_port_.c_str());
|
} else {
|
||||||
|
req.set_header("Host", host_and_port_.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user