mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
* HTTP.{cpp,h} : drop HTTPReq.host
This commit is contained in:
parent
03973cc6d4
commit
a4dc67cba0
9
HTTP.cpp
9
HTTP.cpp
@ -253,21 +253,12 @@ namespace http {
|
||||
if (pos >= eoh)
|
||||
break;
|
||||
}
|
||||
auto it = headers.find("Host");
|
||||
if (it != headers.end ()) {
|
||||
host = it->second;
|
||||
} else if (version == "HTTP/1.1") {
|
||||
return -1; /* 'Host' header required for HTTP/1.1 */
|
||||
} else if (url.host != "") {
|
||||
host = url.host;
|
||||
}
|
||||
return eoh + strlen(HTTP_EOH);
|
||||
}
|
||||
|
||||
std::string HTTPReq::to_string() {
|
||||
std::stringstream ss;
|
||||
ss << method << " " << uri << " " << version << CRLF;
|
||||
ss << "Host: " << host << CRLF;
|
||||
for (auto & h : headers) {
|
||||
ss << h.first << ": " << h.second << CRLF;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user