Repository navigation
net: Align redirect HTTP Fetch with spec comments - #41798
Conversation
|
🔨 Triggering try run (#20850315866) for Linux (WPT) |
|
|
61f4459 to
ffd8fc9
Compare
|
🔨 Triggering try run (#20852548321) for Linux (WPT) |
|
Test results for linux-wpt from try job (#20852548321): Flaky unexpected result (36)
Stable unexpected results that are known to be intermittent (34)
|
|
✨ Try run (#20852548321) succeeded. |
| assert!( | ||
| response | ||
| .actual_response() | ||
| .status | ||
| .try_code() | ||
| .is_some_and(is_redirect_status) | ||
| ); |
There was a problem hiding this comment.
Why assert instead of returning None here?
There was a problem hiding this comment.
It can only be called inside of
servo/components/net/http_loader.rs
Lines 999 to 1003 in d61b7c9
While debugging failing WPT tests related to redirects, I realised that the implementation was out-of-sync with the spec. Add the relevant comments and refactor according to what the order of the spec expects. Testing: no observable behavior Signed-off-by: Tim van der Lippe <[email protected]>
ffd8fc9 to
eb9dc87
Compare
| let location_url = response.actual_response().location_url.clone(); | ||
| // Step 3. Let locationURL be internalResponse’s location URL given request’s current URL’s fragment. | ||
| let location_url = location_url_for_response(&response, request.current_url().fragment()); | ||
| response.actual_response_mut().location_url = location_url.clone(); |
There was a problem hiding this comment.
Is this assignment necessary? I don't see it in the specification text you pated nor in the previous code.
There was a problem hiding this comment.
Yes. Currently it's here:
servo/components/net/http_loader.rs
Line 1031 in 2a759ed
When I remove it, loads of tests start to fail (#41798 (comment)). That said, I am looking into removing lines that don't correspond to the spec (#41799) but it turns out this is quite tricky and requires a lot of debugging to figure out why these lines are crucial.
mrobinson
left a comment
There was a problem hiding this comment.
This seems like a nice improvement.
While debugging failing WPT tests related to redirects, I realised that the implementation was out-of-sync with the spec. Add the relevant comments and refactor according to what the order of the spec expects.
Testing: no observable behavior
Part of #41807