@whatwg-node/node-fetch 0.7.4-alpha-20241125125556-f6d4dd923d74499ecd7ef790e4704bf3bffd1892 → 0.7.4-alpha-20241125130302-670fd9851060fb8e736194f703f4026f9566bf40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/URL.js +1 -0
- package/cjs/fetchNodeHttp.js +1 -1
- package/esm/URL.js +1 -0
- package/esm/fetchNodeHttp.js +1 -1
- package/package.json +1 -1
package/cjs/URL.js
CHANGED
@@ -22,6 +22,7 @@ class PonyfillURL extends fast_url_parser_1.default {
|
|
22
22
|
this.protocol = this.protocol || baseParsed.protocol;
|
23
23
|
this.host = this.host || baseParsed.host;
|
24
24
|
this.pathname = this.pathname || baseParsed.pathname;
|
25
|
+
this.port = this.port || baseParsed.port;
|
25
26
|
}
|
26
27
|
}
|
27
28
|
get origin() {
|
package/cjs/fetchNodeHttp.js
CHANGED
@@ -84,7 +84,7 @@ function fetchNodeHttp(fetchRequest) {
|
|
84
84
|
return;
|
85
85
|
}
|
86
86
|
if (fetchRequest.redirect === 'follow') {
|
87
|
-
const redirectedUrl = new URL_js_1.PonyfillURL(nodeResponse.headers.location, fetchRequest.url);
|
87
|
+
const redirectedUrl = new URL_js_1.PonyfillURL(nodeResponse.headers.location, fetchRequest.parsedUrl || fetchRequest.url);
|
88
88
|
const redirectResponse$ = fetchNodeHttp(new Request_js_1.PonyfillRequest(redirectedUrl, fetchRequest));
|
89
89
|
resolve(redirectResponse$.then(redirectResponse => {
|
90
90
|
redirectResponse.redirected = true;
|
package/esm/URL.js
CHANGED
@@ -18,6 +18,7 @@ export class PonyfillURL extends FastUrl {
|
|
18
18
|
this.protocol = this.protocol || baseParsed.protocol;
|
19
19
|
this.host = this.host || baseParsed.host;
|
20
20
|
this.pathname = this.pathname || baseParsed.pathname;
|
21
|
+
this.port = this.port || baseParsed.port;
|
21
22
|
}
|
22
23
|
}
|
23
24
|
get origin() {
|
package/esm/fetchNodeHttp.js
CHANGED
@@ -81,7 +81,7 @@ export function fetchNodeHttp(fetchRequest) {
|
|
81
81
|
return;
|
82
82
|
}
|
83
83
|
if (fetchRequest.redirect === 'follow') {
|
84
|
-
const redirectedUrl = new PonyfillURL(nodeResponse.headers.location, fetchRequest.url);
|
84
|
+
const redirectedUrl = new PonyfillURL(nodeResponse.headers.location, fetchRequest.parsedUrl || fetchRequest.url);
|
85
85
|
const redirectResponse$ = fetchNodeHttp(new PonyfillRequest(redirectedUrl, fetchRequest));
|
86
86
|
resolve(redirectResponse$.then(redirectResponse => {
|
87
87
|
redirectResponse.redirected = true;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@whatwg-node/node-fetch",
|
3
|
-
"version": "0.7.4-alpha-
|
3
|
+
"version": "0.7.4-alpha-20241125130302-670fd9851060fb8e736194f703f4026f9566bf40",
|
4
4
|
"description": "Fetch API implementation for Node",
|
5
5
|
"sideEffects": false,
|
6
6
|
"dependencies": {
|