Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5316)

Unified Diff: chrome/browser/resource_dispatcher_host.cc

Issue 12982: Disable the content sniffing algorithm if the server instructs us to do so wi... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resource_dispatcher_host_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resource_dispatcher_host.cc
===================================================================
--- chrome/browser/resource_dispatcher_host.cc (revision 6417)
+++ chrome/browser/resource_dispatcher_host.cc (working copy)
@@ -1133,7 +1133,11 @@
std::string mime_type;
request_->GetMimeType(&mime_type);
- if (net::ShouldSniffMimeType(request_->url(), mime_type)) {
+ std::string content_type_options;
+ request_->GetResponseHeaderByName("x-content-type-options",
+ &content_type_options);
+ if (content_type_options != "nosniff" &&
+ net::ShouldSniffMimeType(request_->url(), mime_type)) {
// We're going to look at the data before deciding what the content type
// is. That means we need to delay sending the ResponseStarted message
// over the IPC channel.
« no previous file with comments | « no previous file | chrome/browser/resource_dispatcher_host_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698