-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expose nested browsing context status in RequestClient #41639
Description
We're missing step 2.2 of https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request in our implementation in
servo/components/net/fetch/methods.rs
Lines 1182 to 1183 in 9ca7628
| // Step 2.2 | |
| // TODO If request’s client's target browsing context is a nested browsing context |
This leads to timeouts in tests like https://github.com/servo/servo/blob/main/tests/wpt/tests/upgrade-insecure-requests/link-upgrade.sub.https.html because the iframes loaded from http URLs are never upgraded to https, so they get blocked as mixed content.
We need to:
- add a new
is_nested_browsing_context: booltoservo/components/shared/net/request.rs
Line 187 in 9ca7628
pub struct RequestClient { - set it to true in https://github.com/servo/servo/blob/main/components/script/dom/globalscope.rs#L2610 if:
- the global scope is a Window, and
window.is_top_level()is false
- use the new value in
should_upgrade_navigation_requestviarequest.client
You can test this against ./mach test-wpt tests/wpt/tests/upgrade-insecure-requests and ./mach test-wpt tests/wpt/tests/mixed-content; I would expect a bunch of new subtests going from TIMEOUT to a PASS/FAIL result.