Implement fetch metadata headers (#33830)

* Implement sec-fetch-dest header

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement "is same site" algorithm

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Implement remaining sec-fetch-* headers

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix casing of header names

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix handling Destination::None in sec-fetch-dest

This also removes the comment about wanting to upgrade
to a newer content-security-protocol version because
the csp doesn't implement the "empty" case.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Remove colon from spec comment

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Adjust expected default headers

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix test expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2024-10-16 06:15:56 +02:00 committed by GitHub
parent a2f81d69c1
commit ed959d7a1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 471 additions and 656 deletions

View file

@ -1,13 +1,4 @@
[element-picture.https.sub.html]
[sec-fetch-site - img[src\] - Same origin, no attributes]
expected: FAIL
[sec-fetch-site - img[srcset\] - Same origin, no attributes]
expected: FAIL
[sec-fetch-site - source[srcset\] - Same origin, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Cross-site, no attributes]
expected: FAIL
@ -17,15 +8,6 @@
[sec-fetch-site - source[srcset\] - Cross-site, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same site, no attributes]
expected: FAIL
[sec-fetch-site - img[srcset\] - Same site, no attributes]
expected: FAIL
[sec-fetch-site - source[srcset\] - Same site, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes]
expected: FAIL
@ -35,15 +17,6 @@
[sec-fetch-site - source[srcset\] - Same-Origin -> Cross-Site -> Same-Origin redirect, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Origin -> Same-Site -> Same-Origin redirect, no attributes]
expected: FAIL
[sec-fetch-site - img[srcset\] - Same-Origin -> Same-Site -> Same-Origin redirect, no attributes]
expected: FAIL
[sec-fetch-site - source[srcset\] - Same-Origin -> Same-Site -> Same-Origin redirect, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Cross-Site -> Same Origin, no attributes]
expected: FAIL
@ -71,24 +44,6 @@
[sec-fetch-site - source[srcset\] - Cross-Site -> Cross-Site, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Origin -> Same Origin, no attributes]
expected: FAIL
[sec-fetch-site - img[srcset\] - Same-Origin -> Same Origin, no attributes]
expected: FAIL
[sec-fetch-site - source[srcset\] - Same-Origin -> Same Origin, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Origin -> Same-Site, no attributes]
expected: FAIL
[sec-fetch-site - img[srcset\] - Same-Origin -> Same-Site, no attributes]
expected: FAIL
[sec-fetch-site - source[srcset\] - Same-Origin -> Same-Site, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Origin -> Cross-Site, no attributes]
expected: FAIL
@ -98,24 +53,6 @@
[sec-fetch-site - source[srcset\] - Same-Origin -> Cross-Site, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Site -> Same Origin, no attributes]
expected: FAIL
[sec-fetch-site - img[srcset\] - Same-Site -> Same Origin, no attributes]
expected: FAIL
[sec-fetch-site - source[srcset\] - Same-Site -> Same Origin, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Site -> Same-Site, no attributes]
expected: FAIL
[sec-fetch-site - img[srcset\] - Same-Site -> Same-Site, no attributes]
expected: FAIL
[sec-fetch-site - source[srcset\] - Same-Site -> Same-Site, no attributes]
expected: FAIL
[sec-fetch-site - img[src\] - Same-Site -> Cross-Site, no attributes]
expected: FAIL
@ -124,48 +61,3 @@
[sec-fetch-site - source[srcset\] - Same-Site -> Cross-Site, no attributes]
expected: FAIL
[sec-fetch-mode - img[src\] - no attributes]
expected: FAIL
[sec-fetch-mode - img[srcset\] - no attributes]
expected: FAIL
[sec-fetch-mode - source[srcset\] - no attributes]
expected: FAIL
[sec-fetch-mode - img[src\] - attributes: crossorigin]
expected: FAIL
[sec-fetch-mode - img[srcset\] - attributes: crossorigin]
expected: FAIL
[sec-fetch-mode - source[srcset\] - attributes: crossorigin]
expected: FAIL
[sec-fetch-mode - img[src\] - attributes: crossorigin=anonymous]
expected: FAIL
[sec-fetch-mode - img[srcset\] - attributes: crossorigin=anonymous]
expected: FAIL
[sec-fetch-mode - source[srcset\] - attributes: crossorigin=anonymous]
expected: FAIL
[sec-fetch-mode - img[src\] - attributes: crossorigin=use-credentials]
expected: FAIL
[sec-fetch-mode - img[srcset\] - attributes: crossorigin=use-credentials]
expected: FAIL
[sec-fetch-mode - source[srcset\] - attributes: crossorigin=use-credentials]
expected: FAIL
[sec-fetch-dest - img[src\] - no attributes]
expected: FAIL
[sec-fetch-dest - img[srcset\] - no attributes]
expected: FAIL
[sec-fetch-dest - source[srcset\] - no attributes]
expected: FAIL