Skip to content

Commit 6353c7c

Browse files
committed
perf: replace regex with string compare
1 parent 873ea92 commit 6353c7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function impl (req, resOrSocket, headOrNil, {
6464
}
6565
}
6666

67-
if (!/1\.1|2\.\d/.test(req.httpVersion)) {
67+
if (req.httpVersion !== '1.1' && req.httpVersion !== '2.0') {
6868
throw createError('http version not supported', null, 505)
6969
}
7070

0 commit comments

Comments
 (0)