------------------------------------------------------------ revno: 13664 revision-id: squid3@treenet.co.nz-20141121093001-1te1w6paikc154w0 parent: squid3@treenet.co.nz-20141121092722-p2p9si46dh8jqbht committer: Amos Jeffries branch nick: 3.5 timestamp: Fri 2014-11-21 01:30:01 -0800 message: Alternate-Protocol is a hop-by-hop header Google are pushing Alternate-Protocol header to arbitrarily move clients from HTTP to their experimental and proprietary protocols. When relayed through a proxy this can cause traffic bifurcation with side effects ranging from client visible failures, to traffic increase on the network as proxy caching is bypassed, to security vulnerabilities or privacy information leaks over the experimental protocol. Treating the Alternate-Protocol header as a hop-by-hop header only relevant on client->origin connections we can both prevent the above issues occuring on networks utilizing a proxy, and also participate in the protocol exprimentation process ourselves. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20141121093001-1te1w6paikc154w0 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 9ac5a76dc2227b5855650b8c8eebae01d3e55dba # timestamp: 2014-11-21 09:37:24 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20141121092722-\ # p2p9si46dh8jqbht # # Begin patch === modified file 'src/HttpHeader.cc' --- src/HttpHeader.cc 2014-09-13 13:59:43 +0000 +++ src/HttpHeader.cc 2014-11-21 09:30:01 +0000 @@ -72,6 +72,7 @@ {"Accept-Ranges", HDR_ACCEPT_RANGES, ftStr}, {"Age", HDR_AGE, ftInt}, {"Allow", HDR_ALLOW, ftStr}, + {"Alternate-Protocol", HDR_ALTERNATE_PROTOCOL, ftStr}, {"Authorization", HDR_AUTHORIZATION, ftStr}, /* for now */ {"Cache-Control", HDR_CACHE_CONTROL, ftPCc}, {"Connection", HDR_CONNECTION, ftStr}, @@ -306,6 +307,7 @@ /* hop-by-hop headers */ static HttpHeaderMask HopByHopHeadersMask; static http_hdr_type HopByHopHeadersArr[] = { + HDR_ALTERNATE_PROTOCOL, HDR_CONNECTION, HDR_HTTP2_SETTINGS, HDR_KEEP_ALIVE, === modified file 'src/HttpHeader.h' --- src/HttpHeader.h 2014-09-13 13:59:43 +0000 +++ src/HttpHeader.h 2014-11-21 09:30:01 +0000 @@ -39,6 +39,7 @@ HDR_ACCEPT_RANGES, /**< RFC 7233 */ HDR_AGE, /**< RFC 7234 */ HDR_ALLOW, /**< RFC 7231 */ + HDR_ALTERNATE_PROTOCOL, /**< GFE custom header we may have to erase */ HDR_AUTHENTICATION_INFO, /**< RFC 2617 */ HDR_AUTHORIZATION, /**< RFC 7235, 4559 */ HDR_CACHE_CONTROL, /**< RFC 7234 */