-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Follows whatwg/html#5737. Closes #21730 by incorporating all of those tests.
- Loading branch information
Showing
15 changed files
with
423 additions
and
347 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
spec: https://tools.ietf.org/html/rfc7034 | ||
spec: https://html.spec.whatwg.org/#the-x-frame-options-header | ||
suggested_reviewers: | ||
- annevk | ||
- mikewest | ||
- domenic |
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,2 +1,3 @@ | ||
This directory contains tests for | ||
[HTTP Header Field X-Frame-Options](https://tools.ietf.org/html/rfc7034). | ||
This directory contains tests for [`X-Frame-Options`](https://html.spec.whatwg.org/#the-x-frame-options-header). | ||
|
||
Currently it only tests `<iframe>`. It would be nice to test `<embed>` and `<object>` as well. |
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,43 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>X-Frame-Options variations of DENY</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="./support/helper.sub.js"></script> | ||
|
||
<body> | ||
<script> | ||
"use strict"; | ||
|
||
xfo_simple_tests({ | ||
headerValue: `DENY`, | ||
sameOriginAllowed: false, | ||
crossOriginAllowed: false | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `denY`, | ||
sameOriginAllowed: false, | ||
crossOriginAllowed: false | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: ` DENY `, | ||
sameOriginAllowed: false, | ||
crossOriginAllowed: false | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `DENY`, | ||
cspValue: `default-src 'self'`, | ||
sameOriginAllowed: false, | ||
crossOriginAllowed: false | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `DENY`, | ||
cspValue: `frame-ancestors 'self'`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: false | ||
}); | ||
</script> |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>X-Frame-Options headers use the get, decode, and split algorithm</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support/helper.sub.js"></script> | ||
|
||
<body> | ||
<script> | ||
"use strict"; | ||
|
||
xfo_simple_tests({ | ||
headerValue: `,SAMEORIGIN,,DENY,`, | ||
sameOriginAllowed: false, | ||
crossOriginAllowed: false | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: ` SAMEORIGIN, DENY`, | ||
sameOriginAllowed: false, | ||
crossOriginAllowed: false | ||
}); | ||
</script> |
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,59 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>X-Frame-Options invalid values</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="./support/helper.sub.js"></script> | ||
|
||
<body> | ||
<script> | ||
"use strict"; | ||
|
||
xfo_simple_tests({ | ||
headerValue: `INVALID`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `ALLOW-FROM https://example.com/`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `ALLOW-FROM=https://example.com/`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `ALLOWALL`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `"DENY"`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `"SAMEORIGIN"`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: `"SAMEORIGIN,DENY"`, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
|
||
xfo_simple_tests({ | ||
headerValue: ``, | ||
sameOriginAllowed: true, | ||
crossOriginAllowed: true | ||
}); | ||
</script> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.