mirror of
https://github.com/servo/servo.git
synced 2025-07-01 12:33:40 +01:00
49 lines
1.3 KiB
HTML
49 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/fetch/sec-metadata/resources/helper.js></script>
|
|
|
|
<!-- Same-origin script -->
|
|
<script src="https://{{host}}:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-script.py"></script>
|
|
<script>
|
|
test(t => {
|
|
t.add_cleanup(_ => header = null);
|
|
|
|
assert_header_equals(header, {
|
|
"cause": "forced",
|
|
"destination": "script",
|
|
"target": "subresource",
|
|
"site": "same-origin"
|
|
});
|
|
}, "Same-origin script");
|
|
</script>
|
|
|
|
<!-- Same-site script -->
|
|
<script src="https://{{hosts[][www]}}:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-script.py"></script>
|
|
<script>
|
|
test(t => {
|
|
t.add_cleanup(_ => header = null);
|
|
|
|
assert_header_equals(header, {
|
|
"cause": "forced",
|
|
"destination": "script",
|
|
"target": "subresource",
|
|
"site": "same-site"
|
|
});
|
|
}, "Same-site script");
|
|
</script>
|
|
|
|
<!-- Cross-site script -->
|
|
<script src="https://{{hosts[alt][www]}}:{{ports[https][0]}}/fetch/sec-metadata/resources/echo-as-script.py"></script>
|
|
<script>
|
|
test(t => {
|
|
t.add_cleanup(_ => header = null);
|
|
|
|
assert_header_equals(header, {
|
|
"cause": "forced",
|
|
"destination": "script",
|
|
"target": "subresource",
|
|
"site": "cross-site"
|
|
});
|
|
}, "Cross-site script");
|
|
</script>
|