Bug 225238

Summary: Can't decode empty formdata with fetch
Product: WebKit Reporter: Jimmy Wärting <jimmy>
Component: DOMAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ahmad.saleem792, ap, beidson, bfulgham, cdumez, clopez, ews-watchlist, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch youennf: review+, ews-feeder: commit-queue-

Jimmy Wärting
Reported 2021-04-30 11:07:00 PDT
Safari TP Version: 14.2 OS Version: OS X 10.15.7 Safari: FAIL Firefox: OK IE/Edge: FAIL What steps will reproduce the problem? 1. new Response(new FormData()).formData() What is the expected result? Get back a empty formdata... It can work if you append at least one item into the FormData. What happens instead of that? TypeError: Type error https://github.com/web-platform-tests/wpt/issues/28607 (plz, switch to github issues instead of using bugzilla)
Attachments
Patch (6.34 KB, patch)
2021-05-03 13:32 PDT, Alex Christensen
youennf: review+
ews-feeder: commit-queue-
Alex Christensen
Comment 1 2021-05-03 13:32:36 PDT
EWS Watchlist
Comment 2 2021-05-03 13:33:27 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Alex Christensen
Comment 3 2021-05-03 13:35:20 PDT
@Jimmy, I added two of these lines to your test to verify it returns a FormData that is indeed empty: for (const pair of fd.entries()) { assert_true(false); } You may consider this in your upstream PR. Also, I removed an extra one space indent that crept into all but one line of your test.
youenn fablet
Comment 4 2021-05-03 23:07:19 PDT
Comment on attachment 427594 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427594&action=review > LayoutTests/imported/w3c/web-platform-tests/fetch/api/body/formdata.any.js:5 > + for (const pair of fd.entries()) { assert_true(false); } assert_unreached would be clearer. > LayoutTests/imported/w3c/web-platform-tests/fetch/api/body/formdata.any.js:15 > + for (const pair of fd.entries()) { assert_true(false); } Ditto here.
Radar WebKit Bug Importer
Comment 5 2021-05-07 11:07:37 PDT
Ahmad Saleem
Comment 6 2022-08-01 12:57:17 PDT
I think this didn't landed yet despite r+ because Safari still fail these tests (matched from within patch to WPT): https://wpt.fyi/results/fetch/api/body?label=master&label=experimental&aligned&view=subtest&q=formdata Please ignore my comment, if I am wrong. Thanks!
Alex Christensen
Comment 7 2022-08-02 11:47:32 PDT
EWS
Comment 8 2022-08-02 12:51:43 PDT
Committed 253047@main (0cd625839811): <https://commits.webkit.org/253047@main> Reviewed commits have been landed. Closing PR #2956 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.