Skip to content

Commit

Permalink
Add tests for safelisting simple range headers from preflight
Browse files Browse the repository at this point in the history
  • Loading branch information
rayankans committed Oct 1, 2021
1 parent d6e2a74 commit d939309
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cors/cors-safelisted-request-header.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,18 @@ function safelist(headers, expectPreflight = false) {
["multipart/form-data;\"", true]
].forEach(([mimeType, preflight = false]) => {
safelist({"content-type": mimeType}, preflight);
})
});

[
["100-200", true],
["MB=100-200", true],
["bytes=100-200"],
["BYTES=100-200"],
["bytes=100-200,300-400", true],
["bytes=-200", true],
["bytes=200-"],
["bytes=200-100", true],
[`bytes=1${'0'.repeat(60)}-2${'0'.repeat(60)}`, true],
].forEach(([mimeType, preflight = false]) => {
safelist({"range": mimeType}, preflight);
});

0 comments on commit d939309

Please sign in to comment.