forked from web-platform-tests/wpt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL adds tests for https://fetch.spec.whatwg.org/#concept-method-normalize to check that the methods not listed there are not uppercased. This CL also adds more complete test coverage around case-sensitiveness of request methods. Discussion for not uppercasing "patch" method: whatwg/fetch#50 Bug: 1228178 Change-Id: I003cd65f0c330cc5b4641d79dce721970795c994 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3032582 Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/main@{#926658}
- Loading branch information
1 parent
f665537
commit 84923dc
Showing
3 changed files
with
63 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// META: global=window,worker | ||
|
||
// https://fetch.spec.whatwg.org/#forbidden-method | ||
for (const method of [ | ||
'CONNECT', 'TRACE', 'TRACK', | ||
'connect', 'trace', 'track' | ||
]) { | ||
test(function() { | ||
assert_throws_js(TypeError, | ||
function() { new Request('./', {method: method}); } | ||
); | ||
}, 'Request() with a forbidden method ' + method + ' must throw.'); | ||
} |
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