Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "undici", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "An HTTP/1.1 client, written from scratch for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ 'use strict' | ||
test('invalid content-length', (t) => { | ||
test('request invalid content-length', (t) => { | ||
t.plan(8) | ||
@@ -122,3 +122,3 @@ | ||
test('streaming invalid content-length', (t) => { | ||
test('request streaming invalid content-length', (t) => { | ||
t.plan(4) | ||
@@ -176,3 +176,3 @@ | ||
test('streaming data when content-length=0', (t) => { | ||
test('request streaming data when content-length=0', (t) => { | ||
t.plan(1) | ||
@@ -212,3 +212,3 @@ | ||
test('streaming no body data when content-length=0', (t) => { | ||
test('request streaming no body data when content-length=0', (t) => { | ||
t.plan(2) | ||
@@ -246,1 +246,38 @@ | ||
}) | ||
test('response invalid content length with close', (t) => { | ||
t.plan(3) | ||
const server = createServer((req, res) => { | ||
res.writeHead(200, { | ||
'content-length': 10 | ||
}) | ||
res.end('123') | ||
}) | ||
t.teardown(server.close.bind(server)) | ||
server.listen(0, () => { | ||
const client = new Client(`http://localhost:${server.address().port}`, { | ||
keepAlive: false | ||
}) | ||
t.teardown(client.destroy.bind(client)) | ||
client.on('disconnect', (err) => { | ||
t.strictEqual(err.code, 'UND_ERR_SOCKET') | ||
}) | ||
client.request({ | ||
path: '/', | ||
method: 'GET' | ||
}, (err, data) => { | ||
t.error(err) | ||
data.body | ||
.on('end', () => { | ||
t.fail() | ||
}) | ||
.on('error', (err) => { | ||
t.strictEqual(err.code, 'UND_ERR_SOCKET') | ||
}) | ||
.resume() | ||
}) | ||
}) | ||
}) |
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
Network access
Supply chain riskThis module accesses the network.
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
349704
69
11420
51