mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 05:39:41 +02:00
Automatic update from web-platform-tests Implement `Sec-Fetch-Site: 'none'` for user-initiated navigations. https://mikewest.github.io/sec-metadata/#sec-fetch-site-header defines a `none` value for `Sec-Fetch-Site`, which should be delivered along with navigational requests which were initiated directly from the browser, and not from a user's interaction with websites. This patch implements this new value in `NavigationRequest::AddAdditionalRequestHeaders`, and adds tests for some of the core use cases we expect servers to care about when examining this header: address bar navigations, and bookmark navigations. We'll add additional test cases in future patches as we work out the right answers to the questions raised in [1] and [2]. [1]: https://mikewest.github.io/sec-metadata/#directly-user-initiated [2]: https://docs.google.com/document/d/1YdakWfCR29pVNHURgceKrM_zjGN61xdnCXdZIGpQzxQ Bug: 868286 Change-Id: I4866daba27a8763966cf3b213d0c0e916c0db787 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1520667 Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org> Commit-Queue: Mike West <mkwst@chromium.org> Cr-Commit-Position: refs/heads/master@{#644760} -- wpt-commits: 696d3a7aebc3c610eeddee94fb490aa6662c7e79 wpt-pr: 15806
23 lines
651 B
HTML
23 lines
651 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/fetch/sec-metadata/resources/helper.js></script>
|
|
<script>
|
|
test(t => {
|
|
let expected = {
|
|
"dest": "document",
|
|
"mode": "navigate",
|
|
"site": "none",
|
|
};
|
|
|
|
let actual = {
|
|
"dest": "{{headers[sec-fetch-dest]}}",
|
|
"mode": "{{headers[sec-fetch-mode]}}",
|
|
"site": "{{headers[sec-fetch-site]}}",
|
|
// Skipping `Sec-Fetch-User`, as the test harness isn't consistent here.
|
|
};
|
|
|
|
assert_header_equals(actual, expected);
|
|
}, "This page's top-level navigation.");
|
|
</script>
|