summaryrefslogtreecommitdiff
path: root/ext/fetch/26_fetch.js
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2022-08-17 16:29:26 +0200
committerGitHub <noreply@github.com>2022-08-17 16:29:26 +0200
commit0b0843e4a54d7c1ddf293ac1ccee2479b69a5ba9 (patch)
treef6a16b98ed589d8b2a49a5531bf3328fba49ac29 /ext/fetch/26_fetch.js
parenta2ab5eee015b1dafc1a18cd2bc5f5c5756123d74 (diff)
refactor(fetch/request): use callback for url and method (#15483)
Diffstat (limited to 'ext/fetch/26_fetch.js')
-rw-r--r--ext/fetch/26_fetch.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js
index a069583a7..c980bc9b8 100644
--- a/ext/fetch/26_fetch.js
+++ b/ext/fetch/26_fetch.js
@@ -28,6 +28,7 @@
nullBodyStatus,
networkError,
abortedNetworkError,
+ processUrlList,
} = window.__bootstrap.fetch;
const abortSignal = window.__bootstrap.abortSignal;
const {
@@ -295,6 +296,8 @@
}
if (terminator.aborted) return abortedNetworkError();
+ processUrlList(req.urlList, req.urlListProcessed);
+
/** @type {InnerResponse} */
const response = {
headerList: resp.headers,
@@ -306,7 +309,7 @@
if (this.urlList.length == 0) return null;
return this.urlList[this.urlList.length - 1];
},
- urlList: req.urlList,
+ urlList: req.urlListProcessed,
};
if (redirectStatus(resp.status)) {
switch (req.redirectMode) {
@@ -339,7 +342,8 @@
if (recursive) return response;
if (response.urlList.length === 0) {
- response.urlList = [...new SafeArrayIterator(req.urlList)];
+ processUrlList(req.urlList, req.urlListProcessed);
+ response.urlList = [...new SafeArrayIterator(req.urlListProcessed)];
}
return response;
@@ -407,7 +411,7 @@
const res = extractBody(request.body.source);
request.body = res.body;
}
- ArrayPrototypePush(request.urlList, locationURL.href);
+ ArrayPrototypePush(request.urlList, () => locationURL.href);
return mainFetch(request, true, terminator);
}