Commit 7222f63d authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Revert 3c573272

It may violate draft-09 section 8.1.3.1. Proxy should perseve
host header field.
parent 3c573272
...@@ -160,7 +160,6 @@ namespace { ...@@ -160,7 +160,6 @@ namespace {
const char *IGN_HD[] = { const char *IGN_HD[] = {
"connection", "connection",
"expect", "expect",
"host",
"http2-settings", "http2-settings",
"keep-alive", "keep-alive",
"proxy-connection", "proxy-connection",
......
...@@ -267,15 +267,11 @@ int Http2DownstreamConnection::push_request_headers() ...@@ -267,15 +267,11 @@ int Http2DownstreamConnection::push_request_headers()
nva.push_back(http2::make_nv_ls nva.push_back(http2::make_nv_ls
(":authority", (":authority",
downstream_->get_request_http2_authority())); downstream_->get_request_http2_authority()));
} else { } else if(downstream_->get_norm_request_header("host") == end_headers) {
auto host = downstream_->get_norm_request_header("host"); if(LOG_ENABLED(INFO)) {
if(host == end_headers) { DCLOG(INFO, this) << "host header field missing";
if(LOG_ENABLED(INFO)) {
DCLOG(INFO, this) << "host header field missing";
}
return -1;
} }
nva.push_back(http2::make_nv_ls("host", (*host).second)); return -1;
} }
} else { } else {
// The upstream is HTTP/1 // The upstream is HTTP/1
...@@ -322,15 +318,11 @@ int Http2DownstreamConnection::push_request_headers() ...@@ -322,15 +318,11 @@ int Http2DownstreamConnection::push_request_headers()
authority += util::utos(u.port); authority += util::utos(u.port);
} }
nva.push_back(http2::make_nv_ls(":authority", authority)); nva.push_back(http2::make_nv_ls(":authority", authority));
} else { } else if(downstream_->get_norm_request_header("host") == end_headers) {
auto host = downstream_->get_norm_request_header("host"); if(LOG_ENABLED(INFO)) {
if(host == end_headers) { DCLOG(INFO, this) << "host header field missing";
if(LOG_ENABLED(INFO)) {
DCLOG(INFO, this) << "host header field missing";
}
return -1;
} }
nva.push_back(http2::make_nv_ls("host", (*host).second)); return -1;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment