Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix a few things regarding redirects #25357
Conversation
highfive
commented
Dec 21, 2019
|
Heads up! This PR modifies the following files:
|
|
@bors-servo try=wpt |
Fix a few things regarding redirects See individual commits
|
|
|
|
I can repro locally, guess I failed some rebase before pushing... |
|
@bors-servo try=wpt |
Fix a few things regarding redirects See individual commits
|
|
|
@bors-servo retry
|
Fix a few things regarding redirects See individual commits
|
|
|
|
So I'm very confused right now. Looking at I looked at firefox's implementation if the step 11 of redirect-fetch (https://fetch.spec.whatwg.org/#http-redirect-fetch), which is here: https://searchfox.org/mozilla-central/rev/aec63591821712236a522f7f55116f582ed7c920/dom/fetch/FetchDriver.cpp#1318 At first I thought I was going crazy because the condition is exactly the same but firefox passes those tests. But then I removed the line actually skipping those headers in the redirected request at https://searchfox.org/mozilla-central/rev/aec63591821712236a522f7f55116f582ed7c920/dom/fetch/FetchDriver.cpp#1444 and the test still passed. Apparently, firefox never goes through that The spec here says that for XHR requests, you should be using the fetch API even on XHR (https://xhr.spec.whatwg.org/#the-send()-method) so you should be removing those headers, right ? Am I missing something important here ? Is the spec wrong ? Are the tests wrong ? Is my code wrong ? Is servo's handling of XHR wrong ? |
|
Gecko doesn't use Fetch internally for its XHR implementation. Instead it uses XMLHttpRequestMainThread::AsyncOnChannelRedirect. |
|
I suspect the XHR code ends up hitting https://searchfox.org/mozilla-central/rev/3446310d6cc5c85cde16a82eccf560e9b71a3d44/netwerk/protocol/http/HttpBaseChannel.cpp#3625-3632 and https://searchfox.org/mozilla-central/source/netwerk/protocol/http/HttpBaseChannel.cpp#84 doesn't include Content-Type. |
|
Welp. The test doesn't match the specification, and the right behaviour is not clear to me. I have filed web-platform-tests/wpt#23156 upstream about resolving the mismatch between the Fetch and XHR tests somehow; I propose we merge these changes with the expected failures. |
|
@bors-servo try=wpt |
Fix a few things regarding redirects See individual commits
|
|
|
@bors-servo r+ |
|
|
Fix a few things regarding redirects See individual commits
|
|
Sounds unrelated |
|
@bors-servo retry |
|
|
Eijebong commentedDec 21, 2019
See individual commits