summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-12-09 01:35:49 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-03 01:04:20 +0200
commit2c2b3ab1ba1a9da16f0b0a6145afc0b3f744b0f9 (patch)
tree233e071fdd9f92a94cceae2d9bcc515d9fd02e9e
parenta7e63634ed81bf1f4f3edb938de4e2f7fcea2d0a (diff)
downloaduxp-2c2b3ab1ba1a9da16f0b0a6145afc0b3f744b0f9.tar.gz
[DOM] Align XHR requests with the spec.
-rw-r--r--dom/xhr/XMLHttpRequestMainThread.cpp6
1 files changed, 6 insertions, 0 deletions
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