XMLHttpRequest and fetch() don't combine Content-Length/Content-Type headers
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
People
(Reporter: annevk, Assigned: smayya, Mentored)
References
(Blocks 4 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•4 years ago
|
Updated•4 years ago
|
Comment 1•3 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•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D154864
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D154864
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D156795
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 7•2 years 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•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D157115
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 10•2 years 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•2 years 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•2 years ago
|
||
Backed out for e.g. breaking Tampermonkey userscripts (bug 1798149).
Backout link: https://hg.mozilla.org/integration/autoland/rev/15acd3b1e975fe6e10d37b3ef88a010ed3504a96
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Backed out of beta for due to bug 1798149
Backout link https://hg.mozilla.org/releases/mozilla-beta/rev/bfbcde7b63f6d61821fe2097869e874b041d59c3
Updated•1 years ago
|
Comment 15•10 months ago
|
||
Sunil, :valentin, I just tried this patch-stack on a fresh moz-central branch, and wasn't able to reproduce bug 1798149. Maybe we should try landing it again?
Assignee | ||
Comment 16•10 months ago
|
||
Hello Thomas,
Thanks for checking. I had actually pushed it to try last week, we have the following regression ->
We have new issue here with try.
The problem here is that the extension code is modifying the response headers.
However, it does not modify the original response header from the network resulting in inconsistent response headers being stored internally.
I will be looking into it next week once I have some cycles.
Updated•10 months ago
|
Comment 18•8 months ago
|
||
The severity field for this bug is set to S4
. However, the following bug duplicate has higher severity:
- Bug 1491010: S3
:smayya, could you consider increasing the severity of this bug to S3
?
For more information, please visit BugBot documentation.
Assignee | ||
Updated•8 months ago
|
Description
•