summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/api/request/forbidden-method.any.js
blob: eb13f37f0b5ef83128bbd2adce9eb3341eee5f72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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.');
}