Skip to content

Commit

Permalink
perf: simplify isValidHeaderName (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Nov 16, 2022
1 parent b58e294 commit b041f9a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/fetch/util.js
Expand Up @@ -146,13 +146,7 @@ function isValidHeaderName (potentialValue) {
return false
}

for (const char of potentialValue) {
if (!isValidHTTPToken(char)) {
return false
}
}

return true
return isValidHTTPToken(potentialValue)
}

/**
Expand Down

0 comments on commit b041f9a

Please sign in to comment.