Skip to content

Commit

Permalink
refactor: add missing new operator (#2452)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Nov 23, 2023
1 parent e495094 commit 9e80fb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fetch/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ class Request {
// 2. If method is not a method or method is a forbidden method, then
// throw a TypeError.
if (!isValidHTTPToken(init.method)) {
throw TypeError(`'${init.method}' is not a valid HTTP method.`)
throw new TypeError(`'${init.method}' is not a valid HTTP method.`)
}

if (forbiddenMethodsSet.has(method.toUpperCase())) {
throw TypeError(`'${init.method}' HTTP method is unsupported.`)
throw new TypeError(`'${init.method}' HTTP method is unsupported.`)
}

// 3. Normalize method.
Expand Down

0 comments on commit 9e80fb1

Please sign in to comment.