Commit e20d2ba9 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

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

parent c1be2868
...@@ -405,7 +405,8 @@ int Http2DownstreamConnection::push_request_headers() ...@@ -405,7 +405,8 @@ int Http2DownstreamConnection::push_request_headers()
nva.push_back(http2::make_nv_ls("x-forwarded-for", (*xff).value)); 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 // We use same protocol with :scheme header field
if(scheme.empty()) { if(scheme.empty()) {
if(client_handler_->get_ssl()) { if(client_handler_->get_ssl()) {
......
...@@ -221,7 +221,8 @@ int HttpDownstreamConnection::push_request_headers() ...@@ -221,7 +221,8 @@ int HttpDownstreamConnection::push_request_headers()
http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size()); http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size());
hdrs += "\r\n"; 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: "; hdrs += "X-Forwarded-Proto: ";
if(!downstream_->get_request_http2_scheme().empty()) { if(!downstream_->get_request_http2_scheme().empty()) {
hdrs += downstream_->get_request_http2_scheme(); hdrs += downstream_->get_request_http2_scheme();
......
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