diff options
author | Moonchild <moonchild@palemoon.org> | 2021-12-09 01:35:49 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-07 23:55:45 +0200 |
commit | 57dffbd698fb738695513536e79c9c614bf5c4c0 (patch) | |
tree | d7c446cf17d91f8f47339a09e8baeb5e3fd3cc81 /dom/xhr/XMLHttpRequestMainThread.cpp | |
parent | e0e12932bc933978cf151d038616e6c88f0f2b4c (diff) | |
download | uxp-57dffbd698fb738695513536e79c9c614bf5c4c0.tar.gz |
[DOM] Align XHR requests with the spec.
Diffstat (limited to 'dom/xhr/XMLHttpRequestMainThread.cpp')
-rw-r--r-- | dom/xhr/XMLHttpRequestMainThread.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dom/xhr/XMLHttpRequestMainThread.cpp b/dom/xhr/XMLHttpRequestMainThread.cpp index 9c9f4c648b..ad999c3584 100644 --- a/dom/xhr/XMLHttpRequestMainThread.cpp +++ b/dom/xhr/XMLHttpRequestMainThread.cpp @@ -85,6 +85,7 @@ #include "mozilla/Preferences.h" #include "private/pprio.h" #include "XMLHttpRequestUpload.h" +#include "nsHostObjectProtocolHandler.h" using namespace mozilla::net; @@ -2878,6 +2879,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 |