summaryrefslogtreecommitdiffstats
path: root/dom/fetch
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-06-12 01:46:48 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-06-13 11:52:53 +0200
commite2403eeb5ac9009b9a7b794059fe6df245cf74dd (patch)
tree3cc4416397c1b3be9f278b2c097c4db8e5b35d03 /dom/fetch
parent301ae8c2df5dcec2c8d736e0397db563b621b9fd (diff)
downloadUXP-e2403eeb5ac9009b9a7b794059fe6df245cf74dd.tar
UXP-e2403eeb5ac9009b9a7b794059fe6df245cf74dd.tar.gz
UXP-e2403eeb5ac9009b9a7b794059fe6df245cf74dd.tar.lz
UXP-e2403eeb5ac9009b9a7b794059fe6df245cf74dd.tar.xz
UXP-e2403eeb5ac9009b9a7b794059fe6df245cf74dd.zip
Issue #1587 - Part 9: Immediately reject an already-aborted signal
Diffstat (limited to 'dom/fetch')
-rw-r--r--dom/fetch/Fetch.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp
index 4dbe2de0a..191f4cfc3 100644
--- a/dom/fetch/Fetch.cpp
+++ b/dom/fetch/Fetch.cpp
@@ -332,7 +332,12 @@ FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput,
RefPtr<AbortSignal> signal;
if (aInit.mSignal.WasPassed()) {
signal = &aInit.mSignal.Value();
- // Let's FetchDriver to deal with an already aborted signal.
+ }
+
+ if (signal && signal->Aborted()) {
+ // An already aborted signal should reject immediately.
+ aRv.Throw(NS_ERROR_DOM_ABORT_ERR);
+ return nullptr;
}
RefPtr<FetchObserver> observer;