XMLHttpRequest and fetch() don't combine Content-Length/Content-Type headers
Categories
(Core :: DOM: Networking, defect, P3)
Tracking
()
People
(Reporter: annevk, Assigned: smayya, Mentored)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [necko-triaged])
Attachments
(5 files, 1 obsolete file)
In tests added in https://github.com/web-platform-tests/wpt/pull/27837, rather than returning two Content-Length headers as "6, 6", I get "6", which suggests a header got dropped. Equivalent thing happens for Content-Type.
For XMLHttpRequest (didn't look into fetch()) this is because of this code:
https://searchfox.org/mozilla-central/source/dom/xhr/XMLHttpRequestMainThread.cpp#1194-1216
It seems that was added to fake response headers for blob URLs, but it ends up violating the requirements of the specification.
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
This is not caused by blob URLs. This line should guard against that.
The fix should be calling GetOriginalResponseHeader instead of GetResponseHeader to catch multiple headers.
Assignee | ||
Updated•10 months ago
|
Assignee | ||
Updated•10 months ago
|
Assignee | ||
Comment 2•10 months ago
|
||
Updated•10 months ago
|
Updated•10 months ago
|
Updated•9 months ago
|
Assignee | ||
Comment 3•9 months ago
|
||
Depends on D154864
Updated•9 months ago
|
Updated•9 months ago
|
Assignee | ||
Comment 4•9 months ago
|
||
Depends on D154864
Assignee | ||
Comment 5•9 months ago
|
||
Depends on D156795
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/fe6151585dec Make XMLHttpRequest/fetch to support multiple content-length and content-type headers. r=necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/cda8626f9ccc store original response headers for 304 and 206 response. r=necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/65d4f5822383 improve parsing of content-type headers for fetch r=necko-reviewers,valentin
Comment 7•9 months ago
|
||
Backed out for causing mochitest failures on test_webassembly_compile.html.
[task 2022-09-15T21:17:00.530Z] 21:17:00 INFO - TEST-PASS | dom/promise/tests/test_webassembly_compile.html | correct MIME type error message
[task 2022-09-15T21:17:00.530Z] 21:17:00 INFO - Buffered messages finished
[task 2022-09-15T21:17:00.532Z] 21:17:00 INFO - TEST-UNEXPECTED-FAIL | dom/promise/tests/test_webassembly_compile.html | correct MIME type error message - got "WebAssembly: Response has unsupported MIME type '' expected 'application/wasm'", expected "WebAssembly: Response has unsupported MIME type 'application/js;application/wasm' expected 'application/wasm'"
[task 2022-09-15T21:17:00.532Z] 21:17:00 INFO - SimpleTest.is@SimpleTest/SimpleTest.js:497:14
[task 2022-09-15T21:17:00.532Z] 21:17:00 INFO - compileStreamingBadMime/<@dom/promise/tests/test_webassembly_compile.html:172:11
[task 2022-09-15T21:17:00.533Z] 21:17:00 INFO - Not taking screenshot here: see the one that was previously logged
[task 2022-09-15T21:17:00.535Z] 21:17:00 INFO - TEST-UNEXPECTED-FAIL | dom/promise/tests/test_webassembly_compile.html | correct MIME type error message - got "WebAssembly: Response has unsupported MIME type '' expected 'application/wasm'", expected "WebAssembly: Response has unsupported MIME type 'application/wasm;application/js' expected 'application/wasm'"
[task 2022-09-15T21:17:00.535Z] 21:17:00 INFO - SimpleTest.is@SimpleTest/SimpleTest.js:497:14
[task 2022-09-15T21:17:00.535Z] 21:17:00 INFO - compileStreamingBadMime/<@dom/promise/tests/test_webassembly_compile.html:172:11
[task 2022-09-15T21:17:00.536Z] 21:17:00 INFO - Not taking screenshot here: see the one that was previously logged
[task 2022-09-15T21:17:00.537Z] 21:17:00 INFO - TEST-UNEXPECTED-FAIL | dom/promise/tests/test_webassembly_compile.html | correct MIME type error message - got "WebAssembly: Response has unsupported MIME type '' expected 'application/wasm'", expected "WebAssembly: Response has unsupported MIME type 'application/wasm;' expected 'application/wasm'"
[task 2022-09-15T21:17:00.538Z] 21:17:00 INFO - SimpleTest.is@SimpleTest/SimpleTest.js:497:14
[task 2022-09-15T21:17:00.538Z] 21:17:00 INFO - compileStreamingBadMime/<@dom/promise/tests/test_webassembly_compile.html:172:11
[task 2022-09-15T21:17:00.539Z] 21:17:00 INFO - TEST-PASS | dom/promise/tests/test_webassembly_compile.html | correct MIME type error message
Updated•9 months ago
|
Updated•9 months ago
|
Assignee | ||
Updated•9 months ago
|
Assignee | ||
Comment 8•9 months ago
|
||
Depends on D157115
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/5979ac92fa24 Make XMLHttpRequest/fetch to support multiple content-length and content-type headers. r=necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/ca500b60941e store original response headers for 304 and 206 response. r=necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/b1c8d75d49ef improve parsing of content-type headers for fetch r=necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/0ec0d4234b77 update error logging for mime type parsing failures in web assembly. r=necko-reviewers,valentin,tschuster
Comment 10•9 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5979ac92fa24
https://hg.mozilla.org/mozilla-central/rev/ca500b60941e
https://hg.mozilla.org/mozilla-central/rev/b1c8d75d49ef
https://hg.mozilla.org/mozilla-central/rev/0ec0d4234b77
Comment 11•7 months ago
|
||
Valentin, at this moment there is an issue with the backout of this bug.
I`m trying to fix the issue and will let you know when the backout is done
Comment 12•7 months ago
|
||
Backed out for e.g. breaking Tampermonkey userscripts (bug 1798149).
Backout link: https://hg.mozilla.org/integration/autoland/rev/15acd3b1e975fe6e10d37b3ef88a010ed3504a96
Assignee | ||
Updated•7 months ago
|
Updated•7 months ago
|
Comment 13•7 months ago
|
||
Backed out of beta for due to bug 1798149
Backout link https://hg.mozilla.org/releases/mozilla-beta/rev/bfbcde7b63f6d61821fe2097869e874b041d59c3
Description
•