Comparing version 2.0.6 to 2.0.7
@@ -349,3 +349,3 @@ 'use strict' | ||
/* istanbul ignore next */ | ||
if (nodeMajorVersion >= 12) { | ||
if (nodeMajorVersion === 12) { | ||
super() | ||
@@ -355,2 +355,9 @@ this.initialize( | ||
{}, | ||
client[kHeadersTimeout] | ||
) | ||
} else if (nodeMajorVersion > 12) { | ||
super() | ||
this.initialize( | ||
HTTPParser.RESPONSE, | ||
{}, | ||
client[kMaxHeadersSize], | ||
@@ -479,3 +486,3 @@ insecureHTTPParser, | ||
if (upgrade !== request.upgrade) { | ||
if (upgrade !== Boolean(request.upgrade)) { | ||
util.destroy(socket, new SocketError('bad upgrade')) | ||
@@ -482,0 +489,0 @@ return 1 |
@@ -58,3 +58,3 @@ 'use strict' | ||
this.upgrade = !!upgrade | ||
this.upgrade = upgrade | ||
@@ -61,0 +61,0 @@ this.path = path |
{ | ||
"name": "undici", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "An HTTP/1.1 client, written from scratch for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,6 +10,7 @@ 'use strict' | ||
test('basic upgrade', (t) => { | ||
t.plan(5) | ||
t.plan(6) | ||
const server = net.createServer((c) => { | ||
c.on('data', (d) => { | ||
t.ok(/upgrade: websocket/i.test(d)) | ||
c.write('HTTP/1.1 101\r\n') | ||
@@ -16,0 +17,0 @@ c.write('hello: world\r\n') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
355804
11634