Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/api/request/forbidden-method.any.html - WPT Dashboard Interop Dashboard
- /fetch/api/request/forbidden-method.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /fetch/api/request/forbidden-method.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /fetch/api/request/forbidden-method.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
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.');
}