Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow browsers to block mixed content requests from cross-origin tests. #17300

Conversation

rniwa
Copy link
Contributor

@rniwa rniwa commented Jun 12, 2019

Gecko and Blink by default block mixed content requests.

As a result, header-referrer-strict-origin-when-cross-origin.https.html, header-referrer-strict-origin.https.html,
and beacon/headers/header-referrer-unsafe-url.https.html fail in those two browser engines.

Allow the mixed content beacon requests to be blocked in these tests as allowed by the specification:
https://www.w3.org/TR/mixed-content/#should-block-fetch
https://www.w3.org/TR/mixed-content/#requirements-user-controls

Also fixed a bug in header-referrer-strict-origin-when-cross-origin.https.html that it was not testing cross-origin.

assert_true(navigator.sendBeacon(testUrl), "SendBeacon Succeeded");
const sentBeacon = navigator.sendBeacon(testUrl);
assert_true(sentBeacon || mayBeBlockedAsMixedContent, "SendBeacon Succeeded");
if (!sentBeacon && mayBeBlockedAsMixedContent)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be easier to read if the pass/fail logic wasn't separated into the assert and the if (!sentBeacon)

Gecko and Blink by default block mixed content requests.

As a result, header-referrer-strict-origin-when-cross-origin.https.html, header-referrer-strict-origin.https.html,
and beacon/headers/header-referrer-unsafe-url.https.html fail in those two browser engines.

Allow the mixed content beacon requests to be blocked in these tests as allowed by the specification:
https://www.w3.org/TR/mixed-content/#should-block-fetch
https://www.w3.org/TR/mixed-content/#requirements-user-controls

Also fixed a bug in header-referrer-strict-origin-when-cross-origin.https.html that it was not testing cross-origin.
@rniwa rniwa force-pushed the allow-mixed-content-blocking-in-beacon-tests branch from 9d4296d to a28a06f Compare June 12, 2019 21:38
@toddreifsteck toddreifsteck merged commit eb12be2 into web-platform-tests:master Jun 12, 2019
@rniwa rniwa deleted the allow-mixed-content-blocking-in-beacon-tests branch June 12, 2019 21:58
marcoscaceres pushed a commit that referenced this pull request Jul 23, 2019
…s. (#17300)

Gecko and Blink by default block mixed content requests.

As a result, header-referrer-strict-origin-when-cross-origin.https.html, header-referrer-strict-origin.https.html,
and beacon/headers/header-referrer-unsafe-url.https.html fail in those two browser engines.

Allow the mixed content beacon requests to be blocked in these tests as allowed by the specification:
https://www.w3.org/TR/mixed-content/#should-block-fetch
https://www.w3.org/TR/mixed-content/#requirements-user-controls

Also fixed a bug in header-referrer-strict-origin-when-cross-origin.https.html that it was not testing cross-origin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants