Socket
Socket
Sign inDemoInstall

undici

Package Overview
Dependencies
Maintainers
3
Versions
212
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 5.15.0 to 5.15.1

17

lib/client.js

@@ -444,2 +444,3 @@ 'use strict'

this.contentLength = ''
this.connection = ''
this.maxResponseSize = client[kMaxResponseSize]

@@ -620,2 +621,4 @@ }

this.keepAlive += buf.toString()
} else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
this.connection += buf.toString()
} else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {

@@ -714,3 +717,7 @@ this.contentLength += buf.toString()

this.statusCode = statusCode
this.shouldKeepAlive = shouldKeepAlive
this.shouldKeepAlive = (
shouldKeepAlive ||
// Override llhttp value which does not allow keepAlive for HEAD.
(request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
)

@@ -745,3 +752,3 @@ if (this.statusCode >= 200) {

if (shouldKeepAlive && client[kPipelining]) {
if (this.shouldKeepAlive && client[kPipelining]) {
const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null

@@ -776,3 +783,2 @@

if (request.method === 'HEAD') {
assert(socket[kReset])
return 1

@@ -851,2 +857,3 @@ }

this.keepAlive = ''
this.connection = ''

@@ -1385,4 +1392,4 @@ assert(this.headers.length % 2 === 0)

if (reset) {
socket[kReset] = true
if (reset != null) {
socket[kReset] = reset
}

@@ -1389,0 +1396,0 @@

@@ -147,3 +147,3 @@ 'use strict'

this.reset = reset == null ? false : reset
this.reset = reset == null ? null : reset

@@ -150,0 +150,0 @@ this.host = null

@@ -262,3 +262,3 @@ 'use strict'

value = value instanceof File
value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
? new File([value], filename, options)

@@ -265,0 +265,0 @@ : new FileLike(value, filename, options)

@@ -312,19 +312,10 @@ 'use strict'

const ab = new ArrayBuffer(data.byteLength)
const ab = Buffer.from(data, data.byteOffset, data.byteLength)
if (Buffer.isBuffer(data)) {
// new Buffer signature is deprecated
Buffer.from(ab).set(data)
} else {
new data.constructor(ab).set(data)
}
const value = Buffer.from(ab)
const frame = new WebsocketFrameSend(value)
const frame = new WebsocketFrameSend(ab)
const buffer = frame.createFrame(opcodes.BINARY)
this.#bufferedAmount += value.byteLength
this.#bufferedAmount += ab.byteLength
socket.write(buffer, () => {
this.#bufferedAmount -= value.byteLength
this.#bufferedAmount -= ab.byteLength
})

@@ -331,0 +322,0 @@ } else if (isBlobLike(data)) {

{
"name": "undici",
"version": "5.15.0",
"version": "5.15.1",
"description": "An HTTP/1.1 client, written from scratch for Node.js",

@@ -5,0 +5,0 @@ "homepage": "https://undici.nodejs.org",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc