Index: content/browser/loader/resource_dispatcher_host_impl.cc |
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
index 21183c34ab6026001aeeccdfca30332555a1e1f1..34c2591daad77bd5c7126a9efe54c72981fcaca2 100644 |
--- a/content/browser/loader/resource_dispatcher_host_impl.cc |
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
@@ -1715,12 +1715,16 @@ ResourceDispatcherHostImpl::AddStandardHandlers( |
plugin_service = PluginService::GetInstance(); |
#endif |
- // Insert a buffered event handler to sniff the mime type. |
- // Note: all ResourceHandler following the MimeSniffingResourceHandler should |
- // expect OnWillRead to be called *before* OnResponseStarted as part of the |
- // mime sniffing process. |
- handler.reset(new MimeSniffingResourceHandler( |
- std::move(handler), this, plugin_service, intercepting_handler, request)); |
+ // fetch() ignores mime sniffing. |
+ if (fetch_request_context_type != REQUEST_CONTEXT_TYPE_FETCH) { |
mmenke
2016/09/08 14:19:18
Can we put this logic in MimeTypeHandler? It alre
yhirano
2016/09/14 13:22:18
Done.
RESOURCE_TYPE_XHR contains REQUEST_CONTENT_
mmenke
2016/09/15 15:08:39
Can we disable it for XHRs, too? (There's actuall
yhirano
2016/09/20 12:12:31
I hope we can, but I expect that disabling the fea
|
+ // Insert a buffered event handler to sniff the mime type. |
+ // Note: all ResourceHandler following the MimeSniffingResourceHandler |
+ // should expect OnWillRead to be called *before* OnResponseStarted as |
+ // part of the mime sniffing process. |
+ handler.reset(new MimeSniffingResourceHandler( |
+ std::move(handler), this, plugin_service, intercepting_handler, |
+ request)); |
+ } |
// Add the pre mime sniffing throttles. |
handler.reset(new ThrottlingResourceHandler( |