summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-06-12 01:46:48 +0000
committerMoonchild <moonchild@palemoon.org>2020-06-12 01:46:48 +0000
commit1c97314804cff846def08b122efb32d514bd1a09 (patch)
tree09bf15856e65236d5310f8c625e68c38559cb718
parent94c694d389ceb2c797d7ee1854cc84c87349c2f5 (diff)
downloaduxp-1c97314804cff846def08b122efb32d514bd1a09.tar.gz
Issue #1587 - Part 9: Immediately reject an already-aborted signal
-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 4dbe2de0a1..191f4cfc3e 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;