Skip to content

Commit

Permalink
Bug 1294411 - Update XCTO: nosniff implementation to accept images wh…
Browse files Browse the repository at this point in the history
…ich content type starts with 'image/'. r=dveditz
  • Loading branch information
Christoph Kerschbaumer committed Aug 11, 2016
1 parent 1d71879 commit 0736d8d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions netwerk/protocol/http/nsHttpChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
#include "mozilla/Telemetry.h"
#include "AlternateServices.h"
#include "InterceptedChannel.h"
#include "imgLoader.h"
#include "nsIHttpPushListener.h"
#include "nsIX509Cert.h"
#include "ScopedNSSTypes.h"
Expand Down Expand Up @@ -999,8 +998,7 @@ ProcessXCTO(nsHttpResponseHead* aResponseHead, nsILoadInfo* aLoadInfo)
}

if (aLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_IMAGE) {
if (imgLoader::SupportImageWithMimeType(contentType.get(),
AcceptedMimeTypes::IMAGES_AND_DOCUMENTS)) {
if (StringBeginsWith(contentType, NS_LITERAL_CSTRING("image/"))) {
return NS_OK;
}
return NS_ERROR_CORRUPTED_CONTENT;
Expand Down

0 comments on commit 0736d8d

Please sign in to comment.