Skip to content

Commit

Permalink
refactor: add missing new operator (nodejs#2452)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx authored and crysmags committed Feb 27, 2024
1 parent 4421068 commit e408770
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 e408770

Please sign in to comment.