Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split
Sec-Metadata
into Sec-Fetch-*
.
As of [1], we've split the single `Sec-Metadata` header into multiple headers: `Sec-Fetch-Dist`, `Sec-Fetch-Site`, and `Sec-Fetch-User`. This patch does that work in Chromium. The spec change also added `Sec-Fetch-Mode`, but this patch does not. We'll add that functionality to Chromium in a future CL. Test changes pulled from clap@'s excellent PR at #14771 The test failures are expected: redirect failures are https://crbug.com/872285, object/embed failures are https://crbug.com/860510. XSLT failures are WontFix (some engines support cross-origin XSLT; Blink does not). [1]: w3c/webappsec-fetch-metadata@105103d Bug: 843478 Change-Id: I7654d5e823ad813682ac3eb244bbc244a322e6ca
- Loading branch information
1 parent
a090d4a
commit cdefe28
Showing
25 changed files
with
151 additions
and
116 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,18 +1,11 @@ | ||
function parse_metadata(value) { | ||
let result = {}; | ||
value.split(',').forEach(item => { | ||
let parsed = item.trim().split('='); | ||
result[parsed[0]] = parsed[1]; | ||
}); | ||
return result; | ||
} | ||
|
||
function assert_header_equals(value, expected) { | ||
// check that the returned value is an object, not a String | ||
assert_not_equals(value, "", "Empty Sec-Metadata header."); | ||
let result = parse_metadata(value); | ||
assert_equals(result.cause, expected.cause, "cause"); | ||
assert_equals(result.destination, expected.destination, "destination"); | ||
assert_equals(result.target, expected.target, "target"); | ||
assert_equals(result.site, expected.site, "site"); | ||
if (typeof(value) === "string"){ | ||
assert_not_equals(value, "No header has been recorded"); | ||
value = JSON.parse(value); | ||
} | ||
assert_equals(value.dest, expected.dest, "dest"); | ||
// Mode is commented out as no test cases have been filled out yet | ||
// assert_equals(value.mode, expected.mode, "mode"); | ||
assert_equals(value.site, expected.site, "site"); | ||
assert_equals(value.user, expected.user, "user"); | ||
} |
Oops, something went wrong.