shrpx: Remove x-forwarded-proto header from SPDY downstream
SPDY frame has :scheme header field, so x-forwarded-proto is not necessary.
This commit is contained in:
parent
b43b31c362
commit
18dc6384d4
|
@ -213,10 +213,10 @@ int SpdyDownstreamConnection::push_request_headers()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
size_t nheader = downstream_->get_request_headers().size();
|
size_t nheader = downstream_->get_request_headers().size();
|
||||||
// 14 means :method, :scheme, :path, :version and possible via,
|
// 12 means :method, :scheme, :path, :version and possible via and
|
||||||
// x-forwarded-for and x-forwarded-proto header fields. We rename
|
// x-forwarded-for header fields. We rename host header field as
|
||||||
// host header field as :host.
|
// :host.
|
||||||
const char **nv = new const char*[nheader * 2 + 14 + 1];
|
const char **nv = new const char*[nheader * 2 + 12 + 1];
|
||||||
size_t hdidx = 0;
|
size_t hdidx = 0;
|
||||||
std::string via_value;
|
std::string via_value;
|
||||||
std::string xff_value;
|
std::string xff_value;
|
||||||
|
@ -311,12 +311,6 @@ int SpdyDownstreamConnection::push_request_headers()
|
||||||
nv[hdidx++] = "x-forwarded-for";
|
nv[hdidx++] = "x-forwarded-for";
|
||||||
nv[hdidx++] = xff_value.c_str();
|
nv[hdidx++] = xff_value.c_str();
|
||||||
}
|
}
|
||||||
if(downstream_->get_request_method() != "CONNECT") {
|
|
||||||
// Currently, HTTP connection is used as upstream, so we just
|
|
||||||
// specify it here.
|
|
||||||
nv[hdidx++] = "x-forwarded-proto";
|
|
||||||
nv[hdidx++] = "http";
|
|
||||||
}
|
|
||||||
if(!get_config()->no_via) {
|
if(!get_config()->no_via) {
|
||||||
if(!via_value.empty()) {
|
if(!via_value.empty()) {
|
||||||
via_value += ", ";
|
via_value += ", ";
|
||||||
|
|
Loading…
Reference in New Issue