diff --git a/lib/core/util.js b/lib/core/util.js index 71071aff47f..c7e1f16135a 100644 --- a/lib/core/util.js +++ b/lib/core/util.js @@ -13,7 +13,7 @@ const { InvalidArgumentError } = require('./errors') const { headerNameLowerCasedRecord } = require('./constants') const { tree } = require('./tree') -const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) +const [nodeMajor, nodeMinor] = process.versions.node.split('.', 2).map(v => Number(v)) class BodyAsyncIterable { constructor (body) { diff --git a/lib/mock/mock-utils.js b/lib/mock/mock-utils.js index 7e79d88c507..a41825459a4 100644 --- a/lib/mock/mock-utils.js +++ b/lib/mock/mock-utils.js @@ -97,7 +97,7 @@ function safeUrl (path) { return path } - const pathSegments = path.split('?') + const pathSegments = path.split('?', 3) if (pathSegments.length !== 2) { return path diff --git a/lib/web/websocket/util.js b/lib/web/websocket/util.js index 3e9c5479043..ae8f076c0fb 100644 --- a/lib/web/websocket/util.js +++ b/lib/web/websocket/util.js @@ -206,7 +206,7 @@ function parseExtensions (extensions) { while (position.position < extensions.length) { const pair = collectASequenceOfCodePointsFast(';', extensions, position) - const [name, value = ''] = pair.split('=') + const [name, value = ''] = pair.split('=', 2) extensionList.set( removeHTTPWhitespace(name, true, false),