Skip to content
Myr

Fix `uploadProgress` with form data (#725)

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

authored by Sindre Sorhus · committed by GitHub · parent d7320b9 · Browse files · 3 files+63 added−3 removed
This commit

State

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

Diff stats

3 files+63 added−3 removed

  • tests:+57 added−0 removed
  • other:+6 added−3 removed

3 files+63 added−3 removed

modified:source/core/Ky.ts+2 added-1 removed
226 unmodified lines
227 }228229 const originalBody = this.request.body;230 if (originalBody) {231 // Pass original body to calculate size correctly (before it becomes a stream)231 this.request = streamRequest(this.request, this._options.onUploadProgress);232 this.request = streamRequest(this.request, this._options.onUploadProgress, this._options.body);233 }234 }235 }236
104 unmodified lines
modified:source/utils/body.ts+4 added-2 removed
added:test/formdata-searchparams.ts+57 added