It may violate draft-09 section 8.1.3.1. Proxy should perseve
host header field.
This commit is contained in:
Tatsuhiro Tsujikawa 2013-12-16 21:14:31 +09:00
parent 3c57327274
commit 7222f63dbd
2 changed files with 8 additions and 17 deletions

View File

@ -160,7 +160,6 @@ namespace {
const char *IGN_HD[] = {
"connection",
"expect",
"host",
"http2-settings",
"keep-alive",
"proxy-connection",

View File

@ -267,16 +267,12 @@ int Http2DownstreamConnection::push_request_headers()
nva.push_back(http2::make_nv_ls
(":authority",
downstream_->get_request_http2_authority()));
} else {
auto host = downstream_->get_norm_request_header("host");
if(host == end_headers) {
} else if(downstream_->get_norm_request_header("host") == end_headers) {
if(LOG_ENABLED(INFO)) {
DCLOG(INFO, this) << "host header field missing";
}
return -1;
}
nva.push_back(http2::make_nv_ls("host", (*host).second));
}
} else {
// The upstream is HTTP/1
http_parser_url u;
@ -322,16 +318,12 @@ int Http2DownstreamConnection::push_request_headers()
authority += util::utos(u.port);
}
nva.push_back(http2::make_nv_ls(":authority", authority));
} else {
auto host = downstream_->get_norm_request_header("host");
if(host == end_headers) {
} else if(downstream_->get_norm_request_header("host") == end_headers) {
if(LOG_ENABLED(INFO)) {
DCLOG(INFO, this) << "host header field missing";
}
return -1;
}
nva.push_back(http2::make_nv_ls("host", (*host).second));
}
}
nva.push_back(http2::make_nv_ls(":method",