| Summary: | FetchResponse.formData() should parse headers names as case insensitive | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jimmy Wärting <jimmy> |
| Component: | WebCore Misc. | Assignee: | sideshowbarker <mike> |
| Status: | RESOLVED FIXED | ||
| Severity: | Critical | CC: | achristensen, annevk, cdumez, mike, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 17 | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | https://jsfiddle.net/x0o1mqj8/ | ||
| See Also: | https://github.com/web-platform-tests/wpt/pull/42455 | ||
Pull request: https://github.com/WebKit/WebKit/pull/18689 If we do actually want to have interop on this, I can add WPT tests to the PR — and also I guess, update the algorithm at https://fetch.spec.whatwg.org/#dom-body-formdata to explicitly that the Content-Disposition and Content-Type headers names must be parsed case-insensitively. (Though, as noted in the comment which follows that algorithm in the spec: The algorithm is just “a rough approximation of what is needed for multipart/form-data” — that is, it’s already recognized to be underspecified…) Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/42455 Committed 269144@main (d0c370d532ad): <https://commits.webkit.org/269144@main> Reviewed commits have been landed. Closing PR #18689 and removing active labels. |
## reproducible code: async function init() { var fd = new FormData() fd.set('x', 'y') var blob = await new Response(fd).blob() var body = await blob.text() blob = new Blob([body.toLowerCase()], { // convert boundary to lowercase also. type: blob.type.toLowerCase() }) fd = await new Response(blob).formData() console.log([...fd]) } init() ## Test page: https://jsfiddle.net/x0o1mqj8/ Works in Firefox, and all chromium browsers fails in safari