diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-09-27 11:13:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 11:13:27 +0200 |
commit | 09646854861b5699716300b4ad95cbb51d5ca62e (patch) | |
tree | 248b6798d39dcea04b27057a16efae83ea3afd73 /ext/fetch/23_request.js | |
parent | 8aba521e18e1e11b84171693253ef50ec3fd3c71 (diff) |
refactor(fetch/Request): inline defaultInnerRequest (#12241)
Similar to #12235
Diffstat (limited to 'ext/fetch/23_request.js')
-rw-r--r-- | ext/fetch/23_request.js | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/ext/fetch/23_request.js b/ext/fetch/23_request.js index dfb7e2127..bf1683b35 100644 --- a/ext/fetch/23_request.js +++ b/ext/fetch/23_request.js @@ -62,18 +62,6 @@ * @property {Blob | null} blobUrlEntry */ - const defaultInnerRequest = { - url() { - return this.urlList[0]; - }, - currentUrl() { - return this.urlList[this.urlList.length - 1]; - }, - redirectMode: "follow", - redirectCount: 0, - clientRid: null, - }; - /** * @param {string} method * @param {string} url @@ -87,12 +75,20 @@ blobUrlEntry = blobFromObjectUrl(url); } return { - method: method, + method, headerList, body, + redirectMode: "follow", + redirectCount: 0, urlList: [url], + clientRid: null, blobUrlEntry, - ...defaultInnerRequest, + url() { + return this.urlList[0]; + }, + currentUrl() { + return this.urlList[this.urlList.length - 1]; + }, }; } @@ -112,12 +108,6 @@ return { method: request.method, - url() { - return this.urlList[0]; - }, - currentUrl() { - return this.urlList[this.urlList.length - 1]; - }, headerList, body, redirectMode: request.redirectMode, @@ -125,6 +115,12 @@ urlList: request.urlList, clientRid: request.clientRid, blobUrlEntry: request.blobUrlEntry, + url() { + return this.urlList[0]; + }, + currentUrl() { + return this.urlList[this.urlList.length - 1]; + }, }; } |