From 18dc6384d4f030f690e7b061b9e26f0c96f2ca91 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 9 Feb 2013 17:22:33 +0900 Subject: [PATCH] shrpx: Remove x-forwarded-proto header from SPDY downstream SPDY frame has :scheme header field, so x-forwarded-proto is not necessary. --- src/shrpx_spdy_downstream_connection.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/shrpx_spdy_downstream_connection.cc b/src/shrpx_spdy_downstream_connection.cc index e5f327f..8b9ff6b 100644 --- a/src/shrpx_spdy_downstream_connection.cc +++ b/src/shrpx_spdy_downstream_connection.cc @@ -213,10 +213,10 @@ int SpdyDownstreamConnection::push_request_headers() return 0; } size_t nheader = downstream_->get_request_headers().size(); - // 14 means :method, :scheme, :path, :version and possible via, - // x-forwarded-for and x-forwarded-proto header fields. We rename - // host header field as :host. - const char **nv = new const char*[nheader * 2 + 14 + 1]; + // 12 means :method, :scheme, :path, :version and possible via and + // x-forwarded-for header fields. We rename host header field as + // :host. + const char **nv = new const char*[nheader * 2 + 12 + 1]; size_t hdidx = 0; std::string via_value; std::string xff_value; @@ -311,12 +311,6 @@ int SpdyDownstreamConnection::push_request_headers() nv[hdidx++] = "x-forwarded-for"; 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(!via_value.empty()) { via_value += ", ";