mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 01:33:53 +00:00
small fix to allow fronting
This commit is contained in:
parent
6afe7f164e
commit
dedcc43216
29
httplib.h
29
httplib.h
@ -2066,19 +2066,22 @@ 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) {
|
{
|
||||||
req.set_header("Host", host_.c_str());
|
if (is_ssl()) {
|
||||||
} else {
|
if (port_ == 443) {
|
||||||
req.set_header("Host", host_and_port_.c_str());
|
req.set_header("Host", host_.c_str());
|
||||||
}
|
} else {
|
||||||
} else {
|
req.set_header("Host", host_and_port_.c_str());
|
||||||
if (port_ == 80) {
|
}
|
||||||
req.set_header("Host", host_.c_str());
|
} else {
|
||||||
} else {
|
if (port_ == 80) {
|
||||||
req.set_header("Host", host_and_port_.c_str());
|
req.set_header("Host", host_.c_str());
|
||||||
}
|
} else {
|
||||||
}
|
req.set_header("Host", host_and_port_.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!req.has_header("Accept")) {
|
if (!req.has_header("Accept")) {
|
||||||
req.set_header("Accept", "*/*");
|
req.set_header("Accept", "*/*");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user