nghttpx: Don't send x-forwarded-proto if -s or -p is used
This commit is contained in:
parent
c1be28684a
commit
e20d2ba9c1
|
@ -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()
|
||||||
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();
|
||||||
|
|
Loading…
Reference in New Issue