trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject git commit: TS-3026: SPDY not forwarding Accept-Encoding for FF
Date Wed, 20 Aug 2014 18:27:24 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master cde870b31 -> 7f452ab85


TS-3026: SPDY not forwarding Accept-Encoding for FF


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7f452ab8
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7f452ab8
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7f452ab8

Branch: refs/heads/master
Commit: 7f452ab85039dc32d00a14630550f07651d9aa2b
Parents: cde870b
Author: Sudheer Vinukonda <sudheerv@yahoo-inc.com>
Authored: Wed Aug 20 11:27:09 2014 -0700
Committer: Brian Geffon <briang@apache.org>
Committed: Wed Aug 20 11:27:09 2014 -0700

----------------------------------------------------------------------
 proxy/spdy/SpdyCallbacks.cc | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7f452ab8/proxy/spdy/SpdyCallbacks.cc
----------------------------------------------------------------------
diff --git a/proxy/spdy/SpdyCallbacks.cc b/proxy/spdy/SpdyCallbacks.cc
index a1a585f..252f9a2 100644
--- a/proxy/spdy/SpdyCallbacks.cc
+++ b/proxy/spdy/SpdyCallbacks.cc
@@ -271,6 +271,7 @@ spdy_recv_callback(spdylay_session * /*session*/, uint8_t *buf, size_t
length,
 static void
 spdy_process_syn_stream_frame(SpdyClientSession *sm, SpdyRequest *req)
 {
+  bool acceptEncodingRecvd = false;
   // validate request headers
   for(size_t i = 0; i < req->headers.size(); ++i) {
     const std::string &field = req->headers[i].first;
@@ -286,6 +287,8 @@ spdy_process_syn_stream_frame(SpdyClientSession *sm, SpdyRequest *req)
       req->version = value;
     else if(field == ":host")
       req->host = value;
+    else if(field == "accept-encoding")
+      acceptEncodingRecvd = true;
   }
 
   if(!req->path.size()|| !req->method.size() || !req->scheme.size()
@@ -294,6 +297,11 @@ spdy_process_syn_stream_frame(SpdyClientSession *sm, SpdyRequest *req)
     return;
   }
 
+  if (!acceptEncodingRecvd) {
+    Debug("spdy", "Accept-Encoding header not received, adding gzip for method %s", req->method.c_str());
+    req->headers.push_back(make_pair("accept-encoding", "gzip, deflate"));
+  }
+
   spdy_fetcher_launch(req);
 }
 


Mime
View raw message