Skip to content

Commit e43d015

Browse files
authored
lib: limit split length (#4098)
1 parent d0776e8 commit e43d015

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/core/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { InvalidArgumentError } = require('./errors')
1313
const { headerNameLowerCasedRecord } = require('./constants')
1414
const { tree } = require('./tree')
1515

16-
const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
16+
const [nodeMajor, nodeMinor] = process.versions.node.split('.', 2).map(v => Number(v))
1717

1818
class BodyAsyncIterable {
1919
constructor (body) {

lib/mock/mock-utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function safeUrl (path) {
9797
return path
9898
}
9999

100-
const pathSegments = path.split('?')
100+
const pathSegments = path.split('?', 3)
101101

102102
if (pathSegments.length !== 2) {
103103
return path

lib/web/websocket/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function parseExtensions (extensions) {
206206

207207
while (position.position < extensions.length) {
208208
const pair = collectASequenceOfCodePointsFast(';', extensions, position)
209-
const [name, value = ''] = pair.split('=')
209+
const [name, value = ''] = pair.split('=', 2)
210210

211211
extensionList.set(
212212
removeHTTPWhitespace(name, true, false),

0 commit comments

Comments
 (0)