Skip to content
Myr

Fetch with an uncloned request when possible (#601)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Seth Holladay · committed by GitHub · parent 974f1e9 · Browse files · 1 file+6 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−2 removed

  • other:+6 added−2 removed

1 file+6 added−2 removed

modified:source/core/Ky.ts+6 added-2 removed
298 unmodified lines
299 }300301 const nonRequestOptions = findUnknownOptions(this.request, this._options);302303 // Cloning is done here to prepare in advance for retries304 const mainRequest = this.request;305 this.request = mainRequest.clone();306307 if (this._options.timeout === false) {304 return this._options.fetch(this.request.clone(), nonRequestOptions);308 return this._options.fetch(mainRequest, nonRequestOptions);309 }310307 return timeout(this.request.clone(), nonRequestOptions, this.abortController, this._options as TimeoutOptions);311 return timeout(mainRequest, nonRequestOptions, this.abortController, this._options as TimeoutOptions);312 }313314 /* istanbul ignore next */315 protected _stream(response: Response, onDownloadProgress: Options['onDownloadProgress']) {
55 unmodified lines