Bug 1294411 - Update XCTO: nosniff implementation to accept images which content type starts with 'image/'. r=dveditz

This commit is contained in:
Christoph Kerschbaumer 2016-08-11 14:49:02 +02:00
parent 026f92fc96
commit f2589e5050

View File

@ -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"
@ -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;