nghttpx: Don't send x-forwarded-proto if -s or -p is used

This commit is contained in:
Tatsuhiro Tsujikawa 2014-09-25 00:41:38 +09:00
parent c1be28684a
commit e20d2ba9c1
2 changed files with 4 additions and 2 deletions

View File

@ -405,7 +405,8 @@ int Http2DownstreamConnection::push_request_headers()
nva.push_back(http2::make_nv_ls("x-forwarded-for", (*xff).value));
}
if(downstream_->get_request_method() != "CONNECT") {
if(!get_config()->http2_proxy && !get_config()->client_proxy &&
downstream_->get_request_method() != "CONNECT") {
// We use same protocol with :scheme header field
if(scheme.empty()) {
if(client_handler_->get_ssl()) {

View File

@ -221,7 +221,8 @@ int HttpDownstreamConnection::push_request_headers()
http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size());
hdrs += "\r\n";
}
if(downstream_->get_request_method() != "CONNECT") {
if(!get_config()->http2_proxy && !get_config()->client_proxy &&
downstream_->get_request_method() != "CONNECT") {
hdrs += "X-Forwarded-Proto: ";
if(!downstream_->get_request_http2_scheme().empty()) {
hdrs += downstream_->get_request_http2_scheme();