This commit is contained in:
pfg
2024-11-02 17:13:31 -07:00
committed by GitHub
parent 5e5e7c60f1
commit 497fa59bf0
2 changed files with 10 additions and 3 deletions

View File

@@ -126,7 +126,7 @@ var ResponsePrototype = Response.prototype;
const kUrl = Symbol("kUrl");
class Request extends WebRequest {
[kUrl]: string;
[kUrl]?: string;
constructor(input, init) {
// node-fetch is relaxed with the URL, for example, it allows "/" as a valid URL.
@@ -137,12 +137,11 @@ class Request extends WebRequest {
this[kUrl] = input;
} else {
super(input, init);
this[kUrl] = input.url;
}
}
get url() {
return this[kUrl];
return this[kUrl] ?? super.url;
}
}