diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp index 8a1c1f0ada..a1afb90417 100644 --- a/dom/xhr/XMLHttpRequestMainThread.cpp +++ b/dom/xhr/XMLHttpRequestMainThread.cpp @@ -86,6 +86,7 @@ #include "mozilla/Preferences.h" #include "private/pprio.h" #include "XMLHttpRequestUpload.h" +#include "nsHostObjectProtocolHandler.h" using namespace mozilla::net; @@ -2880,6 +2881,11 @@ XMLHttpRequestMainThread::SendInternal(const RequestBodyBase* aBody) return NS_ERROR_DOM_NETWORK_ERR; } + // non-GET requests aren't allowed for blob. + if (IsBlobURI(mRequestURL) && !mRequestMethod.EqualsLiteral("GET")) { + return NS_ERROR_DOM_NETWORK_ERR; + } + PopulateNetworkInterfaceId(); // XXX We should probably send a warning to the JS console