Skip to content

Commit ba7681d

Browse files
Merge pull request #119 from step-security/npm-audit-fix
fix: Security updates
2 parents e9ba4da + 0c7ee4f commit ba7681d

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

dist/index.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11120,7 +11120,7 @@ module.exports = {
1112011120

1112111121

1112211122
const { parseSetCookie } = __nccwpck_require__(4408)
11123-
const { stringify, getHeadersList } = __nccwpck_require__(3121)
11123+
const { stringify } = __nccwpck_require__(3121)
1112411124
const { webidl } = __nccwpck_require__(1744)
1112511125
const { Headers } = __nccwpck_require__(554)
1112611126

@@ -11196,14 +11196,13 @@ function getSetCookies (headers) {
1119611196

1119711197
webidl.brandCheck(headers, Headers, { strict: false })
1119811198

11199-
const cookies = getHeadersList(headers).cookies
11199+
const cookies = headers.getSetCookie()
1120011200

1120111201
if (!cookies) {
1120211202
return []
1120311203
}
1120411204

11205-
// In older versions of undici, cookies is a list of name:value.
11206-
return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
11205+
return cookies.map((pair) => parseSetCookie(pair))
1120711206
}
1120811207

1120911208
/**
@@ -11631,14 +11630,15 @@ module.exports = {
1163111630
/***/ }),
1163211631

1163311632
/***/ 3121:
11634-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
11633+
/***/ ((module) => {
1163511634

1163611635
"use strict";
1163711636

1163811637

11639-
const assert = __nccwpck_require__(9491)
11640-
const { kHeadersList } = __nccwpck_require__(2785)
11641-
11638+
/**
11639+
* @param {string} value
11640+
* @returns {boolean}
11641+
*/
1164211642
function isCTLExcludingHtab (value) {
1164311643
if (value.length === 0) {
1164411644
return false
@@ -11899,31 +11899,13 @@ function stringify (cookie) {
1189911899
return out.join('; ')
1190011900
}
1190111901

11902-
let kHeadersListNode
11903-
11904-
function getHeadersList (headers) {
11905-
if (headers[kHeadersList]) {
11906-
return headers[kHeadersList]
11907-
}
11908-
11909-
if (!kHeadersListNode) {
11910-
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
11911-
(symbol) => symbol.description === 'headers list'
11912-
)
11913-
11914-
assert(kHeadersListNode, 'Headers cannot be parsed')
11915-
}
11916-
11917-
const headersList = headers[kHeadersListNode]
11918-
assert(headersList)
11919-
11920-
return headersList
11921-
}
11922-
1192311902
module.exports = {
1192411903
isCTLExcludingHtab,
11925-
stringify,
11926-
getHeadersList
11904+
validateCookieName,
11905+
validateCookiePath,
11906+
validateCookieValue,
11907+
toIMFDate,
11908+
stringify
1192711909
}
1192811910

1192911911

@@ -15927,6 +15909,7 @@ const {
1592715909
isValidHeaderName,
1592815910
isValidHeaderValue
1592915911
} = __nccwpck_require__(2538)
15912+
const util = __nccwpck_require__(3837)
1593015913
const { webidl } = __nccwpck_require__(1744)
1593115914
const assert = __nccwpck_require__(9491)
1593215915

@@ -16480,6 +16463,9 @@ Object.defineProperties(Headers.prototype, {
1648016463
[Symbol.toStringTag]: {
1648116464
value: 'Headers',
1648216465
configurable: true
16466+
},
16467+
[util.inspect.custom]: {
16468+
enumerable: false
1648316469
}
1648416470
})
1648516471

@@ -25656,6 +25642,20 @@ class Pool extends PoolBase {
2565625642
? { ...options.interceptors }
2565725643
: undefined
2565825644
this[kFactory] = factory
25645+
25646+
this.on('connectionError', (origin, targets, error) => {
25647+
// If a connection error occurs, we remove the client from the pool,
25648+
// and emit a connectionError event. They will not be re-used.
25649+
// Fixes https://github.com/nodejs/undici/issues/3895
25650+
for (const target of targets) {
25651+
// Do not use kRemoveClient here, as it will close the client,
25652+
// but the client cannot be closed in this state.
25653+
const idx = this[kClients].indexOf(target)
25654+
if (idx !== -1) {
25655+
this[kClients].splice(idx, 1)
25656+
}
25657+
}
25658+
})
2565925659
}
2566025660

2566125661
[kGetDispatcher] () {

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)