mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
refactor(fetch/Request): inline defaultInnerRequest (#12241)
Similar to #12235
This commit is contained in:
parent
8aba521e18
commit
0964685486
1 changed files with 16 additions and 20 deletions
|
@ -62,18 +62,6 @@
|
||||||
* @property {Blob | null} blobUrlEntry
|
* @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} method
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
|
@ -87,12 +75,20 @@
|
||||||
blobUrlEntry = blobFromObjectUrl(url);
|
blobUrlEntry = blobFromObjectUrl(url);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
method: method,
|
method,
|
||||||
headerList,
|
headerList,
|
||||||
body,
|
body,
|
||||||
|
redirectMode: "follow",
|
||||||
|
redirectCount: 0,
|
||||||
urlList: [url],
|
urlList: [url],
|
||||||
|
clientRid: null,
|
||||||
blobUrlEntry,
|
blobUrlEntry,
|
||||||
...defaultInnerRequest,
|
url() {
|
||||||
|
return this.urlList[0];
|
||||||
|
},
|
||||||
|
currentUrl() {
|
||||||
|
return this.urlList[this.urlList.length - 1];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,12 +108,6 @@
|
||||||
|
|
||||||
return {
|
return {
|
||||||
method: request.method,
|
method: request.method,
|
||||||
url() {
|
|
||||||
return this.urlList[0];
|
|
||||||
},
|
|
||||||
currentUrl() {
|
|
||||||
return this.urlList[this.urlList.length - 1];
|
|
||||||
},
|
|
||||||
headerList,
|
headerList,
|
||||||
body,
|
body,
|
||||||
redirectMode: request.redirectMode,
|
redirectMode: request.redirectMode,
|
||||||
|
@ -125,6 +115,12 @@
|
||||||
urlList: request.urlList,
|
urlList: request.urlList,
|
||||||
clientRid: request.clientRid,
|
clientRid: request.clientRid,
|
||||||
blobUrlEntry: request.blobUrlEntry,
|
blobUrlEntry: request.blobUrlEntry,
|
||||||
|
url() {
|
||||||
|
return this.urlList[0];
|
||||||
|
},
|
||||||
|
currentUrl() {
|
||||||
|
return this.urlList[this.urlList.length - 1];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue