Socket
Socket
Sign inDemoInstall

undici

Package Overview
Dependencies
Maintainers
2
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undici - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

examples/proxy/index.js

2

package.json
{
"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()
})
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc