summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;