Skip to content

Commit

Permalink
fix(xframeoptions): added a test that ensures meta equiv tags with `x…
Browse files Browse the repository at this point in the history
…-frame-options` are ignored
  • Loading branch information
argl committed Jul 16, 2024
1 parent 5080718 commit 39cf38c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/files/test_parse_http_equiv_headers_x_frame_options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-Frame-Options" content="DENY" />
<title>Title</title>
</head>
<body></body>
</html>
7 changes: 7 additions & 0 deletions test/x-frame-options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,11 @@ describe("X-Frame-Options", () => {
assert.equal(result.result, Expectation.XFrameOptionsImplementedViaCsp);
assert.isTrue(result.pass);
});

it("does not obey x-frame-options in meta equiv tags", function () {
reqs = emptyRequests("test_parse_http_equiv_headers_x_frame_options.html");
const result = xFrameOptionsTest(reqs);
assert.equal(result.result, Expectation.XFrameOptionsNotImplemented);
assert.isFalse(result.pass);
});
});

0 comments on commit 39cf38c

Please sign in to comment.