1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 08:14:15 +00:00

* HTTP.{cpp,h} : drop HTTPReq.host

This commit is contained in:
hagen 2016-06-04 00:00:00 +00:00
parent 03973cc6d4
commit a4dc67cba0
2 changed files with 0 additions and 10 deletions

View File

@ -253,21 +253,12 @@ namespace http {
if (pos >= eoh) if (pos >= eoh)
break; 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); return eoh + strlen(HTTP_EOH);
} }
std::string HTTPReq::to_string() { std::string HTTPReq::to_string() {
std::stringstream ss; std::stringstream ss;
ss << method << " " << uri << " " << version << CRLF; ss << method << " " << uri << " " << version << CRLF;
ss << "Host: " << host << CRLF;
for (auto & h : headers) { for (auto & h : headers) {
ss << h.first << ": " << h.second << CRLF; ss << h.first << ": " << h.second << CRLF;
} }

1
HTTP.h
View File

@ -69,7 +69,6 @@ namespace http {
std::string version; std::string version;
std::string method; std::string method;
std::string uri; std::string uri;
std::string host;
HTTPReq (): version("HTTP/1.0"), method("GET"), uri("/") {}; HTTPReq (): version("HTTP/1.0"), method("GET"), uri("/") {};