mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Handle HTTP Refresh header (#36393)
Move parsing of Refresh values to Document. Send Refresh header to Document and have meta tags reuse the logic. I transplanted the existing Regex and made some updates so that it passed all the existing parser tests. I added the comments that made sense but it is not very clean to add many comments within the regex. Testing: There are existing WPT tests --------- Signed-off-by: Sebastian C <sebsebmc@gmail.com>
This commit is contained in:
parent
80a6ba5e42
commit
2c7aeca404
13 changed files with 147 additions and 373 deletions
8
tests/wpt/include.ini
vendored
8
tests/wpt/include.ini
vendored
|
@ -158,14 +158,6 @@ skip: true
|
|||
skip: true
|
||||
[semantics]
|
||||
skip: false
|
||||
[document-metadata]
|
||||
skip: false
|
||||
[the-meta-element]
|
||||
skip: false
|
||||
[pragma-directives]
|
||||
skip: false
|
||||
[attr-meta-http-equiv-refresh]
|
||||
skip: true
|
||||
[embedded-content]
|
||||
skip: false
|
||||
[media-elements]
|
||||
|
|
|
@ -1,61 +1,33 @@
|
|||
[header-refresh.https.optional.sub.html]
|
||||
expected: TIMEOUT
|
||||
[sec-fetch-site - Same origin]
|
||||
expected: TIMEOUT
|
||||
|
||||
[sec-fetch-site - Cross-site]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Same site]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Same-Origin -> Cross-Site -> Same-Origin redirect]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-site - Same-Origin -> Same-Site -> Same-Origin redirect]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Cross-Site -> Same Origin]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Cross-Site -> Same-Site]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Cross-Site -> Cross-Site]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-site - Same-Origin -> Same Origin]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-site - Same-Origin -> Same-Site]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Same-Origin -> Cross-Site]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-site - Same-Site -> Same Origin]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Same-Site -> Same-Site]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - Same-Site -> Cross-Site]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - HTTPS downgrade-upgrade]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-mode]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-dest]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-user]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-storage-access - Cross-site]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-storage-access - Same site]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,55 +1,9 @@
|
|||
[header-refresh.optional.sub.html]
|
||||
expected: TIMEOUT
|
||||
[sec-fetch-site - Not sent to non-trustworthy same-origin destination]
|
||||
expected: TIMEOUT
|
||||
|
||||
[sec-fetch-site - Not sent to non-trustworthy same-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-site - Not sent to non-trustworthy cross-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-mode - Not sent to non-trustworthy same-origin destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-mode - Not sent to non-trustworthy same-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-mode - Not sent to non-trustworthy cross-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-dest - Not sent to non-trustworthy same-origin destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-dest - Not sent to non-trustworthy same-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-dest - Not sent to non-trustworthy cross-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-user - Not sent to non-trustworthy same-origin destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-user - Not sent to non-trustworthy same-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-user - Not sent to non-trustworthy cross-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-site - HTTPS downgrade (header not sent)]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - HTTPS upgrade]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
[sec-fetch-site - HTTPS downgrade-upgrade]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-storage-access - Not sent to non-trustworthy same-origin destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-storage-access - Not sent to non-trustworthy same-site destination]
|
||||
expected: NOTRUN
|
||||
|
||||
[sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
[navigate.window.html]
|
||||
expected: TIMEOUT
|
||||
[When navigating the Refresh header needs to be followed]
|
||||
expected: TIMEOUT
|
||||
|
||||
[When there's both a Refresh header and <meta> the Refresh header wins]
|
||||
expected: FAIL
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[allow-scripts-flag-changing-1.html]
|
||||
[Meta refresh is blocked by the allow-scripts sandbox flag at its creation time, not when refresh comes due]
|
||||
expected: FAIL
|
|
@ -0,0 +1,3 @@
|
|||
[allow-scripts-flag-changing-2.html]
|
||||
[Meta refresh of the original iframe is not blocked if moved into a sandboxed iframe]
|
||||
expected: FAIL
|
|
@ -1,52 +0,0 @@
|
|||
[refresh-cross-origin.sub.html]
|
||||
expected: TIMEOUT
|
||||
[cross-origin header refresh with referrer policy "no-referrer" refreshes with the empty string as referrer]
|
||||
expected: TIMEOUT
|
||||
|
||||
[cross-origin meta refresh with referrer policy "no-referrer-when-downgrade" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "no-referrer-when-downgrade" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin meta refresh with referrer policy "origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin meta refresh with referrer policy "origin-when-cross-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "origin-when-cross-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin meta refresh with referrer policy "same-origin" refreshes with the empty string as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "same-origin" refreshes with the empty string as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin meta refresh with referrer policy "strict-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "strict-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin meta refresh with referrer policy "strict-origin-when-cross-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "strict-origin-when-cross-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin meta refresh with referrer policy "unsafe-url" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "unsafe-url" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin meta refresh with referrer policy "" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[cross-origin header refresh with referrer policy "" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
|
@ -1,52 +0,0 @@
|
|||
[refresh-same-origin.html]
|
||||
expected: TIMEOUT
|
||||
[same-origin header refresh with referrer policy "no-referrer" refreshes with the empty string as referrer]
|
||||
expected: TIMEOUT
|
||||
|
||||
[same-origin meta refresh with referrer policy "no-referrer-when-downgrade" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "no-referrer-when-downgrade" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin meta refresh with referrer policy "origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin meta refresh with referrer policy "origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin meta refresh with referrer policy "same-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "same-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin meta refresh with referrer policy "strict-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "strict-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin meta refresh with referrer policy "strict-origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "strict-origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin meta refresh with referrer policy "unsafe-url" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "unsafe-url" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin meta refresh with referrer policy "" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-origin header refresh with referrer policy "" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
|
@ -1,52 +0,0 @@
|
|||
[refresh-same-url.html]
|
||||
expected: TIMEOUT
|
||||
[same-URL header refresh with referrer policy "no-referrer" refreshes with the empty string as referrer]
|
||||
expected: TIMEOUT
|
||||
|
||||
[same-URL meta refresh with referrer policy "no-referrer-when-downgrade" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "no-referrer-when-downgrade" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL meta refresh with referrer policy "origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL meta refresh with referrer policy "origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL meta refresh with referrer policy "same-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "same-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL meta refresh with referrer policy "strict-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "strict-origin" refreshes with origin as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL meta refresh with referrer policy "strict-origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "strict-origin-when-cross-origin" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL meta refresh with referrer policy "unsafe-url" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "unsafe-url" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL meta refresh with referrer policy "" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
||||
|
||||
[same-URL header refresh with referrer policy "" refreshes with full url as referrer]
|
||||
expected: NOTRUN
|
Loading…
Add table
Add a link
Reference in a new issue