Chromium Code Reviews| Index: net/http/http_response_headers.cc |
| diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc |
| index 7ecf37a2352704f02685e9012c64a04c296999bd..676f16db5aa90156a743e77b99823903b67d2964 100644 |
| --- a/net/http/http_response_headers.cc |
| +++ b/net/http/http_response_headers.cc |
| @@ -1504,6 +1504,19 @@ HttpResponseHeaders::GetDataReductionProxyBypassEventType( |
| // response is to minimize information transfer, a sender in general |
| // should not generate representation metadata other than Cache-Control, |
| // Content-Location, Date, ETag, Expires, and Vary. |
| + |
| + // A Via header might also not be present in a 4xx response. If there is |
| + // evidence that the 4xx response was generated by the proxy, bypass it. |
| + if (response_code() >= HTTP_BAD_REQUEST && |
| + response_code() < HTTP_INTERNAL_SERVER_ERROR) { |
| + // If the data reduction proxy ever deprecates use of this "Server" |
| + // header, a 4xx response from the proxy will be interpreted as |
| + // a response that is missing a "Via" header. Either way, the proxy will |
| + // be bypassed. |
| + if (HasHeaderValue("Server", "GFE/2.0")) |
|
cbentzel
2014/05/29 20:04:41
Actually, I'm confused about why we even need this
Matt Welsh
2014/05/29 20:49:18
I think the reason for the GFE/2.0 header check is
bengr
2014/05/30 06:47:44
Done.
|
| + return ProxyService::PROXY_4XX_BYPASS; |
| + // Otherwise, bypass on the missing Via header. |
| + } |
| return ProxyService::MISSING_VIA_HEADER; |
| } |
| // There is no bypass event. |