Bug 1572032 - Provide Unknown-MIME-Type in case of Nosniff + no mime r=ckerschb
authorSebastian Streich <sstreich@mozilla.com>
Thu, 15 Aug 2019 13:06:57 +0000
changeset 488283 6b4a203e3a5567e117999b454cb408f7f5707393
parent 488282 36da938c155282e93753e0d0db8c61bcf1ddd04a
child 488284 8e9d1223d391da60c16ea3e4087123f6c3b9f3a4
push id36440
push userncsoregi@mozilla.com
push dateFri, 16 Aug 2019 03:57:48 +0000
treeherdermozilla-central@a58b7dc85887 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1572032
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1572032 - Provide Unknown-MIME-Type in case of Nosniff + no mime r=ckerschb Differential Revision: https://phabricator.services.mozilla.com/D41943
netwerk/streamconv/converters/nsUnknownDecoder.cpp
--- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp
+++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp
@@ -407,16 +407,18 @@ void nsUnknownDecoder::DetermineContentT
     NS_ASSERTION(mContentType.IsEmpty(), "Content type is already known.");
     if (!mContentType.IsEmpty()) return;
   }
 
   nsCOMPtr<nsIHttpChannel> channel(do_QueryInterface(aRequest));
   if (channel) {
     nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();
     if (loadInfo->GetSkipContentSniffing()) {
+      MutexAutoLock lock(mMutex);
+      mContentType = UNKNOWN_CONTENT_TYPE;
       return;
     }
   }
 
   const char* testData = mBuffer;
   uint32_t testDataLen = mBufferLen;
   // Check if data are compressed.
   nsAutoCString decodedData;