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.25.2 to 5.25.3

8

lib/compat/dispatcher-weakref.js

@@ -34,2 +34,10 @@ 'use strict'

module.exports = function () {
// FIXME: remove workaround when the Node bug is fixed
// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
if (process.env.NODE_V8_COVERAGE) {
return {
WeakRef: CompatWeakRef,
FinalizationRegistry: CompatFinalizer
}
}
return {

@@ -36,0 +44,0 @@ WeakRef: global.WeakRef || CompatWeakRef,

36

lib/core/util.js

@@ -61,27 +61,27 @@ 'use strict'

if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
if (!/^https?:/.test(url.origin || url.protocol)) {
throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
}
if (url.path != null && typeof url.path !== 'string') {
throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
}
if (!(url instanceof URL)) {
if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
}
if (url.pathname != null && typeof url.pathname !== 'string') {
throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
}
if (url.path != null && typeof url.path !== 'string') {
throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
}
if (url.hostname != null && typeof url.hostname !== 'string') {
throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
}
if (url.pathname != null && typeof url.pathname !== 'string') {
throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
}
if (url.origin != null && typeof url.origin !== 'string') {
throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
}
if (url.hostname != null && typeof url.hostname !== 'string') {
throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
}
if (!/^https?:/.test(url.origin || url.protocol)) {
throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
}
if (url.origin != null && typeof url.origin !== 'string') {
throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
}
if (!(url instanceof URL)) {
const port = url.port != null

@@ -88,0 +88,0 @@ ? url.port

'use strict'
const Busboy = require('busboy')
const Busboy = require('@fastify/busboy')
const util = require('../core/util')

@@ -388,6 +388,5 @@ const {

try {
busboy = Busboy({
busboy = new Busboy({
headers,
preservePath: true,
defParamCharset: 'utf8'
preservePath: true
})

@@ -401,4 +400,3 @@ } catch (err) {

})
busboy.on('file', (name, value, info) => {
const { filename, encoding, mimeType } = info
busboy.on('file', (name, value, filename, encoding, mimeType) => {
const chunks = []

@@ -405,0 +403,0 @@

@@ -12,10 +12,2 @@ 'use strict'

function setGlobalOrigin (newOrigin) {
if (
newOrigin !== undefined &&
typeof newOrigin !== 'string' &&
!(newOrigin instanceof URL)
) {
throw new Error('Invalid base url')
}
if (newOrigin === undefined) {

@@ -22,0 +14,0 @@ Object.defineProperty(globalThis, globalOrigin, {

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

@@ -164,4 +164,4 @@ "homepage": "https://undici.nodejs.org",

"dependencies": {
"busboy": "^1.6.0"
"@fastify/busboy": "^2.0.0"
}
}
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