We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84ff3b9 commit 836feb4Copy full SHA for 836feb4
source/core/Ky.ts
@@ -248,8 +248,8 @@ export class Ky {
248
const searchParams = '?' + textSearchParams;
249
const url = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, searchParams);
250
251
- // The spread of `this.request` is required as otherwise it misses the `duplex` option for some reason and throws.
252
- this.request = new globalThis.Request(new globalThis.Request(url, {...this.request}), this.#options as RequestInit);
+ // Recreate request with the updated URL. We already have all options in this.#options, including duplex.
+ this.request = new globalThis.Request(url, this.#options as RequestInit);
253
}
254
255
// If `onUploadProgress` is passed, it uses the stream API internally
0 commit comments