Skip to content

Commit

Permalink
perf: simplify isValidHeaderName (nodejs#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig authored and crysmags committed Feb 27, 2024
1 parent 334a443 commit 259129b
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 259129b

Please sign in to comment.