diff options
author | ricea <ricea@chromium.org> | 2015-04-13 09:41:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-13 16:41:33 +0000 |
commit | 68c95ddb2250145f592a96b3206ec92fb4b7ae37 (patch) | |
tree | 77d2e6be4315c23406ad30f36961798a8c88fbc8 /content | |
parent | ba06335758320a885947e965405aa9ecfa388fd2 (diff) | |
download | chromium_src-68c95ddb2250145f592a96b3206ec92fb4b7ae37.zip chromium_src-68c95ddb2250145f592a96b3206ec92fb4b7ae37.tar.gz chromium_src-68c95ddb2250145f592a96b3206ec92fb4b7ae37.tar.bz2 |
Fix incorrect comment in buffered handler.
buffered_resource_handler.cc contains a comment that
// The network stack only forwards 304 responses that were not received in
// response to a conditional request (i.e., If-Modified-Since).
In practice, the network stack forwards 304 responses for all conditonal
requests that were issued from Blink, so that Blink can reuse cached
resources efficiently.
Removed the incorrect comment, and added a justification for bypassing
the mime-type sniffing code for 304 responses.
TEST=content_unittests
Review URL: https://codereview.chromium.org/1085623003
Cr-Commit-Position: refs/heads/master@{#324859}
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/loader/buffered_resource_handler.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/content/browser/loader/buffered_resource_handler.cc b/content/browser/loader/buffered_resource_handler.cc index 67e74a5..a38eaa9 100644 --- a/content/browser/loader/buffered_resource_handler.cc +++ b/content/browser/loader/buffered_resource_handler.cc @@ -110,16 +110,9 @@ bool BufferedResourceHandler::OnResponseStarted(ResourceResponse* response, bool* defer) { response_ = response; - // TODO(darin): It is very odd to special-case 304 responses at this level. - // We do so only because the code always has, see r24977 and r29355. The - // fact that 204 is no longer special-cased this way suggests that 304 need - // not be special-cased either. - // - // The network stack only forwards 304 responses that were not received in - // response to a conditional request (i.e., If-Modified-Since). Other 304 - // responses end up being translated to 200 or whatever the cached response - // code happens to be. It should be very rare to see a 304 at this level. - + // A 304 response should not contain a Content-Type header (RFC 7232 section + // 4.1). The following code may incorrectly attempt to add a Content-Type to + // the response, and so must be skipped for 304 responses. if (!(response_->head.headers.get() && response_->head.headers->response_code() == 304)) { if (ShouldSniffContent()) { |