-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify
Sec-Fetch-Site
is correct for domains with trailing dots.
`example.com` != `example.com.`. They ought to have the same registrable domain, and therefore compare as `same-site`, rather than `same-origin`. Addresses w3c/webappsec-fetch-metadata#15. Bug: 843478 Change-Id: Ic71afeda69f274c23c19608177756d882307a59d
- Loading branch information
1 parent
4cc42c3
commit 88d8cf9
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<script src=/fetch/sec-metadata/resources/helper.js></script> | ||
<script> | ||
// Site | ||
promise_test(t => { | ||
return fetch("https://{{host}}.:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-json.py") | ||
.then(r => r.json()) | ||
.then(j => { | ||
assert_header_equals(j, { | ||
"dest": "empty", | ||
"site": "same-site", | ||
"user": "?F", | ||
"mode": "cors", | ||
}); | ||
}); | ||
}, "Fetching a resource from the same origin, but spelled with a trailing dot."); | ||
|
||
promise_test(t => { | ||
return fetch("https://{{hosts[][www]}}.:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-json.py") | ||
.then(r => r.json()) | ||
.then(j => { | ||
assert_header_equals(j, { | ||
"dest": "empty", | ||
"site": "same-site", | ||
"user": "?F", | ||
"mode": "cors", | ||
}); | ||
}); | ||
}, "Fetching a resource from the same site, but spelled with a trailing dot."); | ||
|
||
promise_test(t => { | ||
return fetch("https://{{hosts[alt][www]}}.:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-json.py") | ||
.then(r => r.json()) | ||
.then(j => { | ||
assert_header_equals(j, { | ||
"dest": "empty", | ||
"site": "cross-site", | ||
"user": "?F", | ||
"mode": "cors", | ||
}); | ||
}); | ||
}, "Fetching a resource from a cross-site host, spelled with a trailing dot."); | ||
</script> |