forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Server-Timing headers should be explicitly safelisted by CORS
... for access via fetch API. Accessing them from resource/navigation timing is protected by TAO. See whatwg/fetch#1511.
- Loading branch information
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,2 @@ | ||
Access-Control-Allow-Origin: * | ||
Server-Timing: metric2; dur=2.1; desc=blue.png |
14 changes: 14 additions & 0 deletions
14
server-timing/server_timing_headers_not_visible_in_fetch.https.html
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,14 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<meta charset='utf-8' /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/get-host-info.sub.js"></script> | ||
<script> | ||
const {HTTPS_REMOTE_ORIGIN} = get_host_info() | ||
promise_test(async t => { | ||
const response = await fetch(`${HTTPS_REMOTE_ORIGIN}/server-timing/resources/blue_cors.png`, {mode: "cors"}); | ||
assert_equals(response.headers.has("server-timing"), false); | ||
}, "Server-Timing headers should be explicitly allowed by CORS"); | ||
</script> | ||
</head> |