mirror of
https://github.com/actions/setup-dotnet.git
synced 2026-10-23 06:53:05 +01:00
Compare commits
2 Commits
dependabot
...
e2cf7c663b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2cf7c663b | ||
|
|
75763629d4 |
2
.licenses/npm/undici.dep.yml
generated
2
.licenses/npm/undici.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: undici
|
name: undici
|
||||||
version: 6.29.0
|
version: 6.28.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: An HTTP/1.1 client, written from scratch for Node.js
|
summary: An HTTP/1.1 client, written from scratch for Node.js
|
||||||
homepage: https://undici.nodejs.org
|
homepage: https://undici.nodejs.org
|
||||||
|
|||||||
618
dist/cache-save/index.js
vendored
618
dist/cache-save/index.js
vendored
@@ -14290,77 +14290,11 @@ class Request {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
onUpgrade (statusCode, headers, socket) {
|
||||||
* @param {number|null} statusCode
|
|
||||||
* @param {Buffer[]|null} headers
|
|
||||||
* @param {import('node:stream').Duplex} socket
|
|
||||||
* @param {string} [statusText]
|
|
||||||
*/
|
|
||||||
onUpgrade (statusCode, headers, socket, statusText = '') {
|
|
||||||
this.onFinally()
|
|
||||||
|
|
||||||
assert(!this.aborted)
|
assert(!this.aborted)
|
||||||
assert(!this.completed)
|
assert(!this.completed)
|
||||||
|
|
||||||
if (statusCode !== null) {
|
return this[kHandler].onUpgrade(statusCode, headers, socket)
|
||||||
this.#publishUpgradeHeaders(statusCode, headers, statusText)
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = this[kHandler].onUpgrade(statusCode, headers, socket)
|
|
||||||
|
|
||||||
if (!this.aborted) {
|
|
||||||
this.completed = true
|
|
||||||
if (statusCode !== null) {
|
|
||||||
this.#publishUpgradeTrailers()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {number} statusCode
|
|
||||||
* @param {import('node:http2').IncomingHttpHeaders} headers
|
|
||||||
* @param {(headers: import('node:http2').IncomingHttpHeaders) => Buffer[]} parseHeaders
|
|
||||||
* @param {string} [statusText]
|
|
||||||
*/
|
|
||||||
onUpgradeResponse (statusCode, headers, parseHeaders, statusText = '') {
|
|
||||||
assert(!this.aborted)
|
|
||||||
assert(this.completed)
|
|
||||||
|
|
||||||
if (channels.headers.hasSubscribers) {
|
|
||||||
this.#publishUpgradeHeaders(statusCode, parseHeaders(headers), statusText)
|
|
||||||
}
|
|
||||||
this.#publishUpgradeTrailers()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Error} error
|
|
||||||
*/
|
|
||||||
onUpgradeError (error) {
|
|
||||||
assert(!this.aborted)
|
|
||||||
assert(this.completed)
|
|
||||||
|
|
||||||
if (channels.error.hasSubscribers) {
|
|
||||||
channels.error.publish({ request: this, error })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {number} statusCode
|
|
||||||
* @param {Buffer[]} headers
|
|
||||||
* @param {string} statusText
|
|
||||||
*/
|
|
||||||
#publishUpgradeHeaders (statusCode, headers, statusText) {
|
|
||||||
if (channels.headers.hasSubscribers) {
|
|
||||||
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#publishUpgradeTrailers () {
|
|
||||||
if (channels.trailers.hasSubscribers) {
|
|
||||||
channels.trailers.publish({ request: this, trailers: [] })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onComplete (trailers) {
|
onComplete (trailers) {
|
||||||
@@ -16259,7 +16193,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onUpgrade (head) {
|
onUpgrade (head) {
|
||||||
const { upgrade, client, socket, headers, statusCode, statusText } = this
|
const { upgrade, client, socket, headers, statusCode } = this
|
||||||
|
|
||||||
assert(upgrade)
|
assert(upgrade)
|
||||||
assert(client[kSocket] === socket)
|
assert(client[kSocket] === socket)
|
||||||
@@ -16294,10 +16228,9 @@ class Parser {
|
|||||||
client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
|
client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
|
||||||
|
|
||||||
try {
|
try {
|
||||||
request.onUpgrade(statusCode, headers, socket, statusText)
|
request.onUpgrade(statusCode, headers, socket)
|
||||||
} catch (error) {
|
} catch (err) {
|
||||||
util.errorRequest(client, request, error)
|
util.destroy(socket, err)
|
||||||
util.destroy(socket, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
client[kResume]()
|
client[kResume]()
|
||||||
@@ -16704,7 +16637,7 @@ async function connectH1 (client, socket) {
|
|||||||
|
|
||||||
function clearIdleSocketValidation (socket) {
|
function clearIdleSocketValidation (socket) {
|
||||||
if (socket[kIdleSocketValidationTimeout]) {
|
if (socket[kIdleSocketValidationTimeout]) {
|
||||||
clearImmediate(socket[kIdleSocketValidationTimeout])
|
clearTimeout(socket[kIdleSocketValidationTimeout])
|
||||||
socket[kIdleSocketValidationTimeout] = null
|
socket[kIdleSocketValidationTimeout] = null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16713,23 +16646,15 @@ function clearIdleSocketValidation (socket) {
|
|||||||
|
|
||||||
function scheduleIdleSocketValidation (client, socket) {
|
function scheduleIdleSocketValidation (client, socket) {
|
||||||
socket[kIdleSocketValidation] = 1
|
socket[kIdleSocketValidation] = 1
|
||||||
// Yield to the check phase (after poll) so unsolicited bytes / FIN / RST
|
socket[kIdleSocketValidationTimeout] = setTimeout(() => {
|
||||||
// already pending on this idle keep-alive socket are processed before the
|
|
||||||
// next request is written (GHSA-35p6-xmwp-9g52).
|
|
||||||
//
|
|
||||||
// setTimeout(0) pays Node's ~1ms timer floor on every sequential reuse
|
|
||||||
// (#5493). setImmediate avoids that, but an *unref'd* Immediate lets poll
|
|
||||||
// block for ~500ms when the event loop is otherwise idle (#5600 / #5606).
|
|
||||||
// A ref'd Immediate both keeps the pending request alive and makes poll
|
|
||||||
// return immediately — the hybrid those issues asked for.
|
|
||||||
socket[kIdleSocketValidationTimeout] = setImmediate(() => {
|
|
||||||
socket[kIdleSocketValidationTimeout] = null
|
socket[kIdleSocketValidationTimeout] = null
|
||||||
socket[kIdleSocketValidation] = 2
|
socket[kIdleSocketValidation] = 2
|
||||||
|
|
||||||
if (client[kSocket] === socket && !socket.destroyed) {
|
if (client[kSocket] === socket && !socket.destroyed) {
|
||||||
client[kResume]()
|
client[kResume]()
|
||||||
}
|
}
|
||||||
})
|
}, 0)
|
||||||
|
socket[kIdleSocketValidationTimeout].unref?.()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16878,22 +16803,12 @@ function writeH1 (client, request) {
|
|||||||
const socket = client[kSocket]
|
const socket = client[kSocket]
|
||||||
clearIdleSocketValidation(socket)
|
clearIdleSocketValidation(socket)
|
||||||
|
|
||||||
/**
|
const abort = (err) => {
|
||||||
* @param {Error} [error]
|
if (request.aborted || request.completed) {
|
||||||
*/
|
|
||||||
const abort = (error) => {
|
|
||||||
if (request.aborted) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.completed) {
|
util.errorRequest(client, request, err || new RequestAbortedError())
|
||||||
if (request.upgrade || request.method === 'CONNECT') {
|
|
||||||
util.destroy(socket, new InformationalError('aborted'))
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
util.errorRequest(client, request, error || new RequestAbortedError())
|
|
||||||
|
|
||||||
util.destroy(body)
|
util.destroy(body)
|
||||||
util.destroy(socket, new InformationalError('aborted'))
|
util.destroy(socket, new InformationalError('aborted'))
|
||||||
@@ -17350,7 +17265,6 @@ module.exports = connectH1
|
|||||||
|
|
||||||
|
|
||||||
const assert = __nccwpck_require__(4589)
|
const assert = __nccwpck_require__(4589)
|
||||||
const { errorMonitor } = __nccwpck_require__(8474)
|
|
||||||
const { pipeline } = __nccwpck_require__(7075)
|
const { pipeline } = __nccwpck_require__(7075)
|
||||||
const util = __nccwpck_require__(3440)
|
const util = __nccwpck_require__(3440)
|
||||||
const {
|
const {
|
||||||
@@ -17427,15 +17341,6 @@ function parseH2Headers (headers) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {import('node:http2').IncomingHttpHeaders} headers
|
|
||||||
* @returns {Buffer[]}
|
|
||||||
*/
|
|
||||||
function parseH2ResponseHeaders (headers) {
|
|
||||||
const { [HTTP2_HEADER_STATUS]: _statusCode, ...realHeaders } = headers
|
|
||||||
return parseH2Headers(realHeaders)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function connectH2 (client, socket) {
|
async function connectH2 (client, socket) {
|
||||||
client[kSocket] = socket
|
client[kSocket] = socket
|
||||||
|
|
||||||
@@ -17656,32 +17561,22 @@ function writeH2 (client, request) {
|
|||||||
headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`
|
headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`
|
||||||
headers[HTTP2_HEADER_METHOD] = method
|
headers[HTTP2_HEADER_METHOD] = method
|
||||||
|
|
||||||
/**
|
const abort = (err) => {
|
||||||
* @param {Error} [error]
|
if (request.aborted || request.completed) {
|
||||||
*/
|
|
||||||
const abort = (error) => {
|
|
||||||
if (request.aborted) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.completed) {
|
err = err || new RequestAbortedError()
|
||||||
if (method === 'CONNECT' && stream != null) {
|
|
||||||
util.destroy(stream, error || new RequestAbortedError())
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
error = error || new RequestAbortedError()
|
util.errorRequest(client, request, err)
|
||||||
|
|
||||||
util.errorRequest(client, request, error)
|
|
||||||
|
|
||||||
if (stream != null) {
|
if (stream != null) {
|
||||||
util.destroy(stream, error)
|
util.destroy(stream, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We do not destroy the socket as we can continue using the session
|
// We do not destroy the socket as we can continue using the session
|
||||||
// the stream get's destroyed and the session remains to create new streams
|
// the stream get's destroyed and the session remains to create new streams
|
||||||
util.destroy(body, error)
|
util.destroy(body, err)
|
||||||
client[kQueue][client[kRunningIdx]++] = null
|
client[kQueue][client[kRunningIdx]++] = null
|
||||||
client[kResume]()
|
client[kResume]()
|
||||||
}
|
}
|
||||||
@@ -17700,57 +17595,25 @@ function writeH2 (client, request) {
|
|||||||
|
|
||||||
if (method === 'CONNECT') {
|
if (method === 'CONNECT') {
|
||||||
session.ref()
|
session.ref()
|
||||||
|
// We are already connected, streams are pending, first request
|
||||||
|
// will create a new stream. We trigger a request to create the stream and wait until
|
||||||
|
// `ready` event is triggered
|
||||||
// We disabled endStream to allow the user to write to the stream
|
// We disabled endStream to allow the user to write to the stream
|
||||||
stream = session.request(headers, { endStream: false, signal })
|
stream = session.request(headers, { endStream: false, signal })
|
||||||
let upgradeResponseFinished = false
|
|
||||||
|
|
||||||
/**
|
if (stream.id && !stream.pending) {
|
||||||
* @param {import('node:http2').IncomingHttpHeaders} headers
|
|
||||||
*/
|
|
||||||
const onResponse = (headers) => {
|
|
||||||
upgradeResponseFinished = true
|
|
||||||
stream.off(errorMonitor, onUpgradeError)
|
|
||||||
request.onUpgradeResponse(Number(headers[HTTP2_HEADER_STATUS]), headers, parseH2ResponseHeaders)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Error} error
|
|
||||||
*/
|
|
||||||
const onUpgradeError = (error) => {
|
|
||||||
upgradeResponseFinished = true
|
|
||||||
stream.off('response', onResponse)
|
|
||||||
request.onUpgradeError(error)
|
|
||||||
}
|
|
||||||
|
|
||||||
const onReady = () => {
|
|
||||||
try {
|
|
||||||
request.onUpgrade(null, null, stream)
|
request.onUpgrade(null, null, stream)
|
||||||
} catch (error) {
|
|
||||||
stream.off('response', onResponse)
|
|
||||||
abort(error)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.aborted) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.off('error', abort)
|
|
||||||
stream.once(errorMonitor, onUpgradeError)
|
|
||||||
client[kQueue][client[kRunningIdx]++] = null
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.once('response', onResponse)
|
|
||||||
stream.once('error', abort)
|
|
||||||
++session[kOpenStreams]
|
++session[kOpenStreams]
|
||||||
onReady()
|
client[kQueue][client[kRunningIdx]++] = null
|
||||||
|
} else {
|
||||||
|
stream.once('ready', () => {
|
||||||
|
request.onUpgrade(null, null, stream)
|
||||||
|
++session[kOpenStreams]
|
||||||
|
client[kQueue][client[kRunningIdx]++] = null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
stream.once('close', () => {
|
stream.once('close', () => {
|
||||||
if (!upgradeResponseFinished && request.completed) {
|
|
||||||
stream.off('response', onResponse)
|
|
||||||
stream.off(errorMonitor, onUpgradeError)
|
|
||||||
request.onUpgradeError(new InformationalError(`HTTP/2: "stream error" received - code ${stream.rstCode}`))
|
|
||||||
}
|
|
||||||
session[kOpenStreams] -= 1
|
session[kOpenStreams] -= 1
|
||||||
if (session[kOpenStreams] === 0) session.unref()
|
if (session[kOpenStreams] === 0) session.unref()
|
||||||
})
|
})
|
||||||
@@ -20449,7 +20312,6 @@ class RetryHandler {
|
|||||||
this.end = null
|
this.end = null
|
||||||
this.etag = null
|
this.etag = null
|
||||||
this.resume = null
|
this.resume = null
|
||||||
this.headersSent = false
|
|
||||||
|
|
||||||
// Handle possible onConnect duplication
|
// Handle possible onConnect duplication
|
||||||
this.handler.onConnect(reason => {
|
this.handler.onConnect(reason => {
|
||||||
@@ -20462,20 +20324,6 @@ class RetryHandler {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
checkpointResponseEnd (headers, resume) {
|
|
||||||
if (this.end == null && this.opts.method !== 'HEAD') {
|
|
||||||
const contentLength = headers['content-length']
|
|
||||||
this.end = contentLength != null ? Number(contentLength) - 1 : null
|
|
||||||
|
|
||||||
assert(
|
|
||||||
this.end == null || Number.isFinite(this.end),
|
|
||||||
'invalid content-length'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.resume = this.end != null ? resume : null
|
|
||||||
}
|
|
||||||
|
|
||||||
onRequestSent () {
|
onRequestSent () {
|
||||||
if (this.handler.onRequestSent) {
|
if (this.handler.onRequestSent) {
|
||||||
this.handler.onRequestSent()
|
this.handler.onRequestSent()
|
||||||
@@ -20564,12 +20412,7 @@ class RetryHandler {
|
|||||||
this.retryCount += 1
|
this.retryCount += 1
|
||||||
|
|
||||||
if (statusCode >= 300) {
|
if (statusCode >= 300) {
|
||||||
// Only expose a response if no earlier attempt has reached the caller.
|
if (this.retryOpts.statusCodes.includes(statusCode) === false) {
|
||||||
// Otherwise abort this attempt so the error settles the existing body
|
|
||||||
// instead of replacing it with a new response.
|
|
||||||
if (!this.headersSent && this.retryOpts.statusCodes.includes(statusCode) === false) {
|
|
||||||
this.headersSent = true
|
|
||||||
this.checkpointResponseEnd(headers, resume)
|
|
||||||
return this.handler.onHeaders(
|
return this.handler.onHeaders(
|
||||||
statusCode,
|
statusCode,
|
||||||
rawHeaders,
|
rawHeaders,
|
||||||
@@ -20638,15 +20481,8 @@ class RetryHandler {
|
|||||||
|
|
||||||
const { start, size, end = size - 1 } = contentRange
|
const { start, size, end = size - 1 } = contentRange
|
||||||
|
|
||||||
if (this.start !== start || (this.end != null && this.end !== end)) {
|
assert(this.start === start, 'content-range mismatch')
|
||||||
this.abort(
|
assert(this.end == null || this.end === end, 'content-range mismatch')
|
||||||
new RequestRetryError('Content-Range mismatch', statusCode, {
|
|
||||||
headers,
|
|
||||||
data: { count: this.retryCount }
|
|
||||||
})
|
|
||||||
)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
this.resume = resume
|
this.resume = resume
|
||||||
return true
|
return true
|
||||||
@@ -20658,7 +20494,6 @@ class RetryHandler {
|
|||||||
const range = parseRangeHeader(headers['content-range'])
|
const range = parseRangeHeader(headers['content-range'])
|
||||||
|
|
||||||
if (range == null) {
|
if (range == null) {
|
||||||
this.headersSent = true
|
|
||||||
return this.handler.onHeaders(
|
return this.handler.onHeaders(
|
||||||
statusCode,
|
statusCode,
|
||||||
rawHeaders,
|
rawHeaders,
|
||||||
@@ -20697,7 +20532,6 @@ class RetryHandler {
|
|||||||
)
|
)
|
||||||
|
|
||||||
this.resume = resume
|
this.resume = resume
|
||||||
this.headersSent = true
|
|
||||||
this.etag = headers.etag != null ? headers.etag : null
|
this.etag = headers.etag != null ? headers.etag : null
|
||||||
|
|
||||||
// Weak etags are not useful for comparison nor cache
|
// Weak etags are not useful for comparison nor cache
|
||||||
@@ -20737,7 +20571,7 @@ class RetryHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onError (err) {
|
onError (err) {
|
||||||
if (this.aborted || isDisturbed(this.opts.body) || (this.headersSent && this.resume == null)) {
|
if (this.aborted || isDisturbed(this.opts.body)) {
|
||||||
return this.handler.onError(err)
|
return this.handler.onError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25195,49 +25029,6 @@ const COLON = 0x3A
|
|||||||
*/
|
*/
|
||||||
const SPACE = 0x20
|
const SPACE = 0x20
|
||||||
|
|
||||||
const DATA = Buffer.from('data')
|
|
||||||
const EVENT = Buffer.from('event')
|
|
||||||
const ID = Buffer.from('id')
|
|
||||||
const RETRY = Buffer.from('retry')
|
|
||||||
|
|
||||||
function isASCIINumberBytes (buffer, start) {
|
|
||||||
if (start >= buffer.length) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = start; i < buffer.length; i++) {
|
|
||||||
if (buffer[i] < 0x30 || buffer[i] > 0x39) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
function isValidLastEventIdBytes (buffer, start) {
|
|
||||||
for (let i = start; i < buffer.length; i++) {
|
|
||||||
if (buffer[i] === 0x00) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
function isFieldName (line, length, field) {
|
|
||||||
if (length !== field.length) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < length; i++) {
|
|
||||||
if (line[i] !== field[i]) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} EventSourceStreamEvent
|
* @typedef {object} EventSourceStreamEvent
|
||||||
* @type {object}
|
* @type {object}
|
||||||
@@ -25278,14 +25069,11 @@ class EventSourceStream extends Transform {
|
|||||||
eventEndCheck = false
|
eventEndCheck = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Buffer[]}
|
* @type {Buffer}
|
||||||
*/
|
*/
|
||||||
chunks = []
|
buffer = null
|
||||||
|
|
||||||
chunkIndex = 0
|
|
||||||
pos = 0
|
pos = 0
|
||||||
lineChunkIndex = 0
|
|
||||||
linePos = 0
|
|
||||||
|
|
||||||
event = {
|
event = {
|
||||||
data: undefined,
|
data: undefined,
|
||||||
@@ -25324,20 +25112,92 @@ class EventSourceStream extends Transform {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chunks.push(chunk)
|
// Cache the chunk in the buffer, as the data might not be complete while
|
||||||
|
// processing it
|
||||||
|
// TODO: Investigate if there is a more performant way to handle
|
||||||
|
// incoming chunks
|
||||||
|
// see: https://github.com/nodejs/undici/issues/2630
|
||||||
|
if (this.buffer) {
|
||||||
|
this.buffer = Buffer.concat([this.buffer, chunk])
|
||||||
|
} else {
|
||||||
|
this.buffer = chunk
|
||||||
|
}
|
||||||
|
|
||||||
// Strip leading byte-order-mark if we opened the stream and started
|
// Strip leading byte-order-mark if we opened the stream and started
|
||||||
// the processing of the incoming data
|
// the processing of the incoming data
|
||||||
if (this.checkBOM) {
|
if (this.checkBOM) {
|
||||||
if (this.handleBOM()) {
|
switch (this.buffer.length) {
|
||||||
|
case 1:
|
||||||
|
// Check if the first byte is the same as the first byte of the BOM
|
||||||
|
if (this.buffer[0] === BOM[0]) {
|
||||||
|
// If it is, we need to wait for more data
|
||||||
callback()
|
callback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
|
// BOM anymore
|
||||||
|
this.checkBOM = false
|
||||||
|
|
||||||
|
// The buffer only contains one byte so we need to wait for more data
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
case 2:
|
||||||
|
// Check if the first two bytes are the same as the first two bytes
|
||||||
|
// of the BOM
|
||||||
|
if (
|
||||||
|
this.buffer[0] === BOM[0] &&
|
||||||
|
this.buffer[1] === BOM[1]
|
||||||
|
) {
|
||||||
|
// If it is, we need to wait for more data, because the third byte
|
||||||
|
// is needed to determine if it is the BOM or not
|
||||||
|
callback()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
while (this.hasCurrentByte()) {
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
const byte = this.currentByte()
|
// BOM anymore
|
||||||
|
this.checkBOM = false
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
// Check if the first three bytes are the same as the first three
|
||||||
|
// bytes of the BOM
|
||||||
|
if (
|
||||||
|
this.buffer[0] === BOM[0] &&
|
||||||
|
this.buffer[1] === BOM[1] &&
|
||||||
|
this.buffer[2] === BOM[2]
|
||||||
|
) {
|
||||||
|
// If it is, we can drop the buffered data, as it is only the BOM
|
||||||
|
this.buffer = Buffer.alloc(0)
|
||||||
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
|
// BOM anymore
|
||||||
|
this.checkBOM = false
|
||||||
|
|
||||||
|
// Await more data
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// If it is not the BOM, we can start processing the data
|
||||||
|
this.checkBOM = false
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
// The buffer is longer than 3 bytes, so we can drop the BOM if it is
|
||||||
|
// present
|
||||||
|
if (
|
||||||
|
this.buffer[0] === BOM[0] &&
|
||||||
|
this.buffer[1] === BOM[1] &&
|
||||||
|
this.buffer[2] === BOM[2]
|
||||||
|
) {
|
||||||
|
// Remove the BOM from the buffer
|
||||||
|
this.buffer = this.buffer.subarray(3)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
|
this.checkBOM = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.pos < this.buffer.length) {
|
||||||
// If the previous line ended with an end-of-line, we need to check
|
// If the previous line ended with an end-of-line, we need to check
|
||||||
// if the next character is also an end-of-line.
|
// if the next character is also an end-of-line.
|
||||||
if (this.eventEndCheck) {
|
if (this.eventEndCheck) {
|
||||||
@@ -25350,9 +25210,10 @@ class EventSourceStream extends Transform {
|
|||||||
if (this.crlfCheck) {
|
if (this.crlfCheck) {
|
||||||
// If the current character is a line feed, we can remove it
|
// If the current character is a line feed, we can remove it
|
||||||
// from the buffer and reset the crlfCheck flag
|
// from the buffer and reset the crlfCheck flag
|
||||||
if (byte === LF) {
|
if (this.buffer[this.pos] === LF) {
|
||||||
|
this.buffer = this.buffer.subarray(this.pos + 1)
|
||||||
|
this.pos = 0
|
||||||
this.crlfCheck = false
|
this.crlfCheck = false
|
||||||
this.consumeCurrentByte()
|
|
||||||
|
|
||||||
// It is possible that the line feed is not the end of the
|
// It is possible that the line feed is not the end of the
|
||||||
// event. We need to check if the next character is an
|
// event. We need to check if the next character is an
|
||||||
@@ -25368,17 +25229,19 @@ class EventSourceStream extends Transform {
|
|||||||
this.crlfCheck = false
|
this.crlfCheck = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (byte === LF || byte === CR) {
|
if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
|
||||||
// If the current character is a carriage return, we need to
|
// If the current character is a carriage return, we need to
|
||||||
// set the crlfCheck flag to true, as we need to check if the
|
// set the crlfCheck flag to true, as we need to check if the
|
||||||
// next character is a line feed so we can remove it from the
|
// next character is a line feed so we can remove it from the
|
||||||
// buffer
|
// buffer
|
||||||
if (byte === CR) {
|
if (this.buffer[this.pos] === CR) {
|
||||||
this.crlfCheck = true
|
this.crlfCheck = true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.consumeCurrentByte()
|
this.buffer = this.buffer.subarray(this.pos + 1)
|
||||||
if (this.hasPendingEvent()) {
|
this.pos = 0
|
||||||
|
if (
|
||||||
|
this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {
|
||||||
this.processEvent(this.event)
|
this.processEvent(this.event)
|
||||||
}
|
}
|
||||||
this.clearEvent()
|
this.clearEvent()
|
||||||
@@ -25392,18 +25255,22 @@ class EventSourceStream extends Transform {
|
|||||||
|
|
||||||
// If the current character is an end-of-line, we can process the
|
// If the current character is an end-of-line, we can process the
|
||||||
// line
|
// line
|
||||||
if (byte === LF || byte === CR) {
|
if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
|
||||||
// If the current character is a carriage return, we need to
|
// If the current character is a carriage return, we need to
|
||||||
// set the crlfCheck flag to true, as we need to check if the
|
// set the crlfCheck flag to true, as we need to check if the
|
||||||
// next character is a line feed
|
// next character is a line feed
|
||||||
if (byte === CR) {
|
if (this.buffer[this.pos] === CR) {
|
||||||
this.crlfCheck = true
|
this.crlfCheck = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// In any case, we can process the line as we reached an
|
// In any case, we can process the line as we reached an
|
||||||
// end-of-line character
|
// end-of-line character
|
||||||
this.parseLine(this.readLine(), this.event)
|
this.parseLine(this.buffer.subarray(0, this.pos), this.event)
|
||||||
this.consumeCurrentByte()
|
|
||||||
|
// Remove the processed line from the buffer
|
||||||
|
this.buffer = this.buffer.subarray(this.pos + 1)
|
||||||
|
// Reset the position as we removed the processed line from the buffer
|
||||||
|
this.pos = 0
|
||||||
// A line was processed and this could be the end of the event. We need
|
// A line was processed and this could be the end of the event. We need
|
||||||
// to check if the next line is empty to determine if the event is
|
// to check if the next line is empty to determine if the event is
|
||||||
// finished.
|
// finished.
|
||||||
@@ -25411,7 +25278,7 @@ class EventSourceStream extends Transform {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
this.advanceCursor()
|
this.pos++
|
||||||
}
|
}
|
||||||
|
|
||||||
callback()
|
callback()
|
||||||
@@ -25436,53 +25303,64 @@ class EventSourceStream extends Transform {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let fieldLength = line.length
|
let field = ''
|
||||||
let valueStart = line.length
|
let value = ''
|
||||||
|
|
||||||
// If the line contains a U+003A COLON character (:)
|
// If the line contains a U+003A COLON character (:)
|
||||||
if (colonPosition !== -1) {
|
if (colonPosition !== -1) {
|
||||||
fieldLength = colonPosition
|
// Collect the characters on the line before the first U+003A COLON
|
||||||
|
// character (:), and let field be that string.
|
||||||
|
// TODO: Investigate if there is a more performant way to extract the
|
||||||
|
// field
|
||||||
|
// see: https://github.com/nodejs/undici/issues/2630
|
||||||
|
field = line.subarray(0, colonPosition).toString('utf8')
|
||||||
|
|
||||||
// Collect the characters on the line after the first U+003A COLON
|
// Collect the characters on the line after the first U+003A COLON
|
||||||
// character (:), and let value be that string.
|
// character (:), and let value be that string.
|
||||||
// If value starts with a U+0020 SPACE character, remove it from value.
|
// If value starts with a U+0020 SPACE character, remove it from value.
|
||||||
valueStart = colonPosition + 1
|
let valueStart = colonPosition + 1
|
||||||
if (line[valueStart] === SPACE) {
|
if (line[valueStart] === SPACE) {
|
||||||
++valueStart
|
++valueStart
|
||||||
}
|
}
|
||||||
}
|
// TODO: Investigate if there is a more performant way to extract the
|
||||||
|
// value
|
||||||
|
// see: https://github.com/nodejs/undici/issues/2630
|
||||||
|
value = line.subarray(valueStart).toString('utf8')
|
||||||
|
|
||||||
if (isFieldName(line, fieldLength, DATA)) {
|
// Otherwise, the string is not empty but does not contain a U+003A COLON
|
||||||
const value = line.toString('utf8', valueStart)
|
// character (:)
|
||||||
|
|
||||||
if (event.data === undefined) {
|
|
||||||
event.data = value
|
|
||||||
} else {
|
} else {
|
||||||
event.data += `\n${value}`
|
// Process the field using the steps described below, using the whole
|
||||||
}
|
// line as the field name, and the empty string as the field value.
|
||||||
return
|
field = line.toString('utf8')
|
||||||
|
value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFieldName(line, fieldLength, RETRY)) {
|
// Modify the event with the field name and value. The value is also
|
||||||
if (isASCIINumberBytes(line, valueStart)) {
|
// decoded as UTF-8
|
||||||
event.retry = line.toString('utf8', valueStart)
|
switch (field) {
|
||||||
|
case 'data':
|
||||||
|
if (event[field] === undefined) {
|
||||||
|
event[field] = value
|
||||||
|
} else {
|
||||||
|
event[field] += `\n${value}`
|
||||||
}
|
}
|
||||||
return
|
break
|
||||||
|
case 'retry':
|
||||||
|
if (isASCIINumber(value)) {
|
||||||
|
event[field] = value
|
||||||
}
|
}
|
||||||
|
break
|
||||||
if (isFieldName(line, fieldLength, ID)) {
|
case 'id':
|
||||||
if (isValidLastEventIdBytes(line, valueStart)) {
|
if (isValidLastEventId(value)) {
|
||||||
event.id = line.toString('utf8', valueStart)
|
event[field] = value
|
||||||
}
|
}
|
||||||
return
|
break
|
||||||
}
|
case 'event':
|
||||||
|
|
||||||
if (isFieldName(line, fieldLength, EVENT)) {
|
|
||||||
const value = line.toString('utf8', valueStart)
|
|
||||||
|
|
||||||
if (value.length > 0) {
|
if (value.length > 0) {
|
||||||
event.event = value
|
event[field] = value
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25512,151 +25390,12 @@ class EventSourceStream extends Transform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearEvent () {
|
clearEvent () {
|
||||||
this.event.data = undefined
|
this.event = {
|
||||||
this.event.event = undefined
|
data: undefined,
|
||||||
this.event.id = undefined
|
event: undefined,
|
||||||
this.event.retry = undefined
|
id: undefined,
|
||||||
|
retry: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
hasPendingEvent () {
|
|
||||||
return this.event.data !== undefined ||
|
|
||||||
this.event.event !== undefined ||
|
|
||||||
this.event.id !== undefined ||
|
|
||||||
this.event.retry !== undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
hasCurrentByte () {
|
|
||||||
return this.chunkIndex < this.chunks.length &&
|
|
||||||
this.pos < this.chunks[this.chunkIndex].length
|
|
||||||
}
|
|
||||||
|
|
||||||
currentByte () {
|
|
||||||
return this.chunks[this.chunkIndex][this.pos]
|
|
||||||
}
|
|
||||||
|
|
||||||
consumeCurrentByte () {
|
|
||||||
this.advanceCursor()
|
|
||||||
this.syncLineStartToCursor()
|
|
||||||
}
|
|
||||||
|
|
||||||
advanceCursor () {
|
|
||||||
this.pos++
|
|
||||||
|
|
||||||
while (this.chunkIndex < this.chunks.length && this.pos >= this.chunks[this.chunkIndex].length) {
|
|
||||||
this.chunkIndex++
|
|
||||||
this.pos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
syncLineStartToCursor () {
|
|
||||||
this.lineChunkIndex = this.chunkIndex
|
|
||||||
this.linePos = this.pos
|
|
||||||
this.dropConsumedChunks()
|
|
||||||
}
|
|
||||||
|
|
||||||
dropConsumedChunks () {
|
|
||||||
while (this.lineChunkIndex > 0) {
|
|
||||||
this.chunks.shift()
|
|
||||||
this.lineChunkIndex--
|
|
||||||
this.chunkIndex--
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.chunkIndex === this.chunks.length) {
|
|
||||||
this.chunks.length = 0
|
|
||||||
this.chunkIndex = 0
|
|
||||||
this.pos = 0
|
|
||||||
this.lineChunkIndex = 0
|
|
||||||
this.linePos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readLine () {
|
|
||||||
if (this.lineChunkIndex === this.chunkIndex) {
|
|
||||||
return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos)
|
|
||||||
}
|
|
||||||
|
|
||||||
const chunks = []
|
|
||||||
let length = 0
|
|
||||||
|
|
||||||
for (let i = this.lineChunkIndex; i <= this.chunkIndex; i++) {
|
|
||||||
const chunk = this.chunks[i]
|
|
||||||
const start = i === this.lineChunkIndex ? this.linePos : 0
|
|
||||||
const end = i === this.chunkIndex ? this.pos : chunk.length
|
|
||||||
const slice = chunk.subarray(start, end)
|
|
||||||
length += slice.length
|
|
||||||
chunks.push(slice)
|
|
||||||
}
|
|
||||||
|
|
||||||
return Buffer.concat(chunks, length)
|
|
||||||
}
|
|
||||||
|
|
||||||
peekBufferedByte (offset) {
|
|
||||||
let chunkIndex = this.lineChunkIndex
|
|
||||||
let pos = this.linePos
|
|
||||||
|
|
||||||
while (chunkIndex < this.chunks.length) {
|
|
||||||
const chunk = this.chunks[chunkIndex]
|
|
||||||
const remaining = chunk.length - pos
|
|
||||||
|
|
||||||
if (offset < remaining) {
|
|
||||||
return chunk[pos + offset]
|
|
||||||
}
|
|
||||||
|
|
||||||
offset -= remaining
|
|
||||||
chunkIndex++
|
|
||||||
pos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
discardLeadingBytes (count) {
|
|
||||||
while (count > 0 && this.lineChunkIndex < this.chunks.length) {
|
|
||||||
const chunk = this.chunks[this.lineChunkIndex]
|
|
||||||
const remaining = chunk.length - this.linePos
|
|
||||||
|
|
||||||
if (count < remaining) {
|
|
||||||
this.linePos += count
|
|
||||||
count = 0
|
|
||||||
} else {
|
|
||||||
count -= remaining
|
|
||||||
this.lineChunkIndex++
|
|
||||||
this.linePos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.chunkIndex = this.lineChunkIndex
|
|
||||||
this.pos = this.linePos
|
|
||||||
this.dropConsumedChunks()
|
|
||||||
}
|
|
||||||
|
|
||||||
handleBOM () {
|
|
||||||
const first = this.peekBufferedByte(0)
|
|
||||||
const second = this.peekBufferedByte(1)
|
|
||||||
const third = this.peekBufferedByte(2)
|
|
||||||
|
|
||||||
if (second === undefined) {
|
|
||||||
if (first === BOM[0]) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.checkBOM = false
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (third === undefined) {
|
|
||||||
if (first === BOM[0] && second === BOM[1]) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.checkBOM = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (first === BOM[0] && second === BOM[1] && third === BOM[2]) {
|
|
||||||
this.discardLeadingBytes(3)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.checkBOM = false
|
|
||||||
return !this.hasCurrentByte()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36925,7 +36664,7 @@ function establishWebSocketConnection (url, protocols, client, ws, onEstablish,
|
|||||||
// is specified, the server needs to include the same field and one of
|
// is specified, the server needs to include the same field and one of
|
||||||
// the selected subprotocol values in its response for the connection to
|
// the selected subprotocol values in its response for the connection to
|
||||||
// be established.
|
// be established.
|
||||||
if (requestProtocols === null || !requestProtocols.includes(secProtocol)) {
|
if (!requestProtocols.includes(secProtocol)) {
|
||||||
failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
|
failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -37686,12 +37425,7 @@ class PerMessageDeflate {
|
|||||||
|
|
||||||
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
|
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
|
||||||
callback(new MessageSizeExceededError())
|
callback(new MessageSizeExceededError())
|
||||||
// The inflater may still hold buffered input that can emit a late
|
|
||||||
// zlib error. Remove the data listener, then deterministically stop
|
|
||||||
// the stream so a subsequent 'error' cannot fire without a listener
|
|
||||||
// (which would terminate the process as an unhandled error event).
|
|
||||||
this.#inflate.removeAllListeners()
|
this.#inflate.removeAllListeners()
|
||||||
this.#inflate.destroy()
|
|
||||||
this.#inflate = null
|
this.#inflate = null
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
618
dist/setup/index.js
vendored
618
dist/setup/index.js
vendored
@@ -16589,77 +16589,11 @@ class Request {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
onUpgrade (statusCode, headers, socket) {
|
||||||
* @param {number|null} statusCode
|
|
||||||
* @param {Buffer[]|null} headers
|
|
||||||
* @param {import('node:stream').Duplex} socket
|
|
||||||
* @param {string} [statusText]
|
|
||||||
*/
|
|
||||||
onUpgrade (statusCode, headers, socket, statusText = '') {
|
|
||||||
this.onFinally()
|
|
||||||
|
|
||||||
assert(!this.aborted)
|
assert(!this.aborted)
|
||||||
assert(!this.completed)
|
assert(!this.completed)
|
||||||
|
|
||||||
if (statusCode !== null) {
|
return this[kHandler].onUpgrade(statusCode, headers, socket)
|
||||||
this.#publishUpgradeHeaders(statusCode, headers, statusText)
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = this[kHandler].onUpgrade(statusCode, headers, socket)
|
|
||||||
|
|
||||||
if (!this.aborted) {
|
|
||||||
this.completed = true
|
|
||||||
if (statusCode !== null) {
|
|
||||||
this.#publishUpgradeTrailers()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {number} statusCode
|
|
||||||
* @param {import('node:http2').IncomingHttpHeaders} headers
|
|
||||||
* @param {(headers: import('node:http2').IncomingHttpHeaders) => Buffer[]} parseHeaders
|
|
||||||
* @param {string} [statusText]
|
|
||||||
*/
|
|
||||||
onUpgradeResponse (statusCode, headers, parseHeaders, statusText = '') {
|
|
||||||
assert(!this.aborted)
|
|
||||||
assert(this.completed)
|
|
||||||
|
|
||||||
if (channels.headers.hasSubscribers) {
|
|
||||||
this.#publishUpgradeHeaders(statusCode, parseHeaders(headers), statusText)
|
|
||||||
}
|
|
||||||
this.#publishUpgradeTrailers()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Error} error
|
|
||||||
*/
|
|
||||||
onUpgradeError (error) {
|
|
||||||
assert(!this.aborted)
|
|
||||||
assert(this.completed)
|
|
||||||
|
|
||||||
if (channels.error.hasSubscribers) {
|
|
||||||
channels.error.publish({ request: this, error })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {number} statusCode
|
|
||||||
* @param {Buffer[]} headers
|
|
||||||
* @param {string} statusText
|
|
||||||
*/
|
|
||||||
#publishUpgradeHeaders (statusCode, headers, statusText) {
|
|
||||||
if (channels.headers.hasSubscribers) {
|
|
||||||
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#publishUpgradeTrailers () {
|
|
||||||
if (channels.trailers.hasSubscribers) {
|
|
||||||
channels.trailers.publish({ request: this, trailers: [] })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onComplete (trailers) {
|
onComplete (trailers) {
|
||||||
@@ -18558,7 +18492,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onUpgrade (head) {
|
onUpgrade (head) {
|
||||||
const { upgrade, client, socket, headers, statusCode, statusText } = this
|
const { upgrade, client, socket, headers, statusCode } = this
|
||||||
|
|
||||||
assert(upgrade)
|
assert(upgrade)
|
||||||
assert(client[kSocket] === socket)
|
assert(client[kSocket] === socket)
|
||||||
@@ -18593,10 +18527,9 @@ class Parser {
|
|||||||
client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
|
client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
|
||||||
|
|
||||||
try {
|
try {
|
||||||
request.onUpgrade(statusCode, headers, socket, statusText)
|
request.onUpgrade(statusCode, headers, socket)
|
||||||
} catch (error) {
|
} catch (err) {
|
||||||
util.errorRequest(client, request, error)
|
util.destroy(socket, err)
|
||||||
util.destroy(socket, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
client[kResume]()
|
client[kResume]()
|
||||||
@@ -19003,7 +18936,7 @@ async function connectH1 (client, socket) {
|
|||||||
|
|
||||||
function clearIdleSocketValidation (socket) {
|
function clearIdleSocketValidation (socket) {
|
||||||
if (socket[kIdleSocketValidationTimeout]) {
|
if (socket[kIdleSocketValidationTimeout]) {
|
||||||
clearImmediate(socket[kIdleSocketValidationTimeout])
|
clearTimeout(socket[kIdleSocketValidationTimeout])
|
||||||
socket[kIdleSocketValidationTimeout] = null
|
socket[kIdleSocketValidationTimeout] = null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19012,23 +18945,15 @@ function clearIdleSocketValidation (socket) {
|
|||||||
|
|
||||||
function scheduleIdleSocketValidation (client, socket) {
|
function scheduleIdleSocketValidation (client, socket) {
|
||||||
socket[kIdleSocketValidation] = 1
|
socket[kIdleSocketValidation] = 1
|
||||||
// Yield to the check phase (after poll) so unsolicited bytes / FIN / RST
|
socket[kIdleSocketValidationTimeout] = setTimeout(() => {
|
||||||
// already pending on this idle keep-alive socket are processed before the
|
|
||||||
// next request is written (GHSA-35p6-xmwp-9g52).
|
|
||||||
//
|
|
||||||
// setTimeout(0) pays Node's ~1ms timer floor on every sequential reuse
|
|
||||||
// (#5493). setImmediate avoids that, but an *unref'd* Immediate lets poll
|
|
||||||
// block for ~500ms when the event loop is otherwise idle (#5600 / #5606).
|
|
||||||
// A ref'd Immediate both keeps the pending request alive and makes poll
|
|
||||||
// return immediately — the hybrid those issues asked for.
|
|
||||||
socket[kIdleSocketValidationTimeout] = setImmediate(() => {
|
|
||||||
socket[kIdleSocketValidationTimeout] = null
|
socket[kIdleSocketValidationTimeout] = null
|
||||||
socket[kIdleSocketValidation] = 2
|
socket[kIdleSocketValidation] = 2
|
||||||
|
|
||||||
if (client[kSocket] === socket && !socket.destroyed) {
|
if (client[kSocket] === socket && !socket.destroyed) {
|
||||||
client[kResume]()
|
client[kResume]()
|
||||||
}
|
}
|
||||||
})
|
}, 0)
|
||||||
|
socket[kIdleSocketValidationTimeout].unref?.()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19177,22 +19102,12 @@ function writeH1 (client, request) {
|
|||||||
const socket = client[kSocket]
|
const socket = client[kSocket]
|
||||||
clearIdleSocketValidation(socket)
|
clearIdleSocketValidation(socket)
|
||||||
|
|
||||||
/**
|
const abort = (err) => {
|
||||||
* @param {Error} [error]
|
if (request.aborted || request.completed) {
|
||||||
*/
|
|
||||||
const abort = (error) => {
|
|
||||||
if (request.aborted) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.completed) {
|
util.errorRequest(client, request, err || new RequestAbortedError())
|
||||||
if (request.upgrade || request.method === 'CONNECT') {
|
|
||||||
util.destroy(socket, new InformationalError('aborted'))
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
util.errorRequest(client, request, error || new RequestAbortedError())
|
|
||||||
|
|
||||||
util.destroy(body)
|
util.destroy(body)
|
||||||
util.destroy(socket, new InformationalError('aborted'))
|
util.destroy(socket, new InformationalError('aborted'))
|
||||||
@@ -19649,7 +19564,6 @@ module.exports = connectH1
|
|||||||
|
|
||||||
|
|
||||||
const assert = __nccwpck_require__(4589)
|
const assert = __nccwpck_require__(4589)
|
||||||
const { errorMonitor } = __nccwpck_require__(8474)
|
|
||||||
const { pipeline } = __nccwpck_require__(7075)
|
const { pipeline } = __nccwpck_require__(7075)
|
||||||
const util = __nccwpck_require__(3440)
|
const util = __nccwpck_require__(3440)
|
||||||
const {
|
const {
|
||||||
@@ -19726,15 +19640,6 @@ function parseH2Headers (headers) {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {import('node:http2').IncomingHttpHeaders} headers
|
|
||||||
* @returns {Buffer[]}
|
|
||||||
*/
|
|
||||||
function parseH2ResponseHeaders (headers) {
|
|
||||||
const { [HTTP2_HEADER_STATUS]: _statusCode, ...realHeaders } = headers
|
|
||||||
return parseH2Headers(realHeaders)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function connectH2 (client, socket) {
|
async function connectH2 (client, socket) {
|
||||||
client[kSocket] = socket
|
client[kSocket] = socket
|
||||||
|
|
||||||
@@ -19955,32 +19860,22 @@ function writeH2 (client, request) {
|
|||||||
headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`
|
headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}`
|
||||||
headers[HTTP2_HEADER_METHOD] = method
|
headers[HTTP2_HEADER_METHOD] = method
|
||||||
|
|
||||||
/**
|
const abort = (err) => {
|
||||||
* @param {Error} [error]
|
if (request.aborted || request.completed) {
|
||||||
*/
|
|
||||||
const abort = (error) => {
|
|
||||||
if (request.aborted) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.completed) {
|
err = err || new RequestAbortedError()
|
||||||
if (method === 'CONNECT' && stream != null) {
|
|
||||||
util.destroy(stream, error || new RequestAbortedError())
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
error = error || new RequestAbortedError()
|
util.errorRequest(client, request, err)
|
||||||
|
|
||||||
util.errorRequest(client, request, error)
|
|
||||||
|
|
||||||
if (stream != null) {
|
if (stream != null) {
|
||||||
util.destroy(stream, error)
|
util.destroy(stream, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We do not destroy the socket as we can continue using the session
|
// We do not destroy the socket as we can continue using the session
|
||||||
// the stream get's destroyed and the session remains to create new streams
|
// the stream get's destroyed and the session remains to create new streams
|
||||||
util.destroy(body, error)
|
util.destroy(body, err)
|
||||||
client[kQueue][client[kRunningIdx]++] = null
|
client[kQueue][client[kRunningIdx]++] = null
|
||||||
client[kResume]()
|
client[kResume]()
|
||||||
}
|
}
|
||||||
@@ -19999,57 +19894,25 @@ function writeH2 (client, request) {
|
|||||||
|
|
||||||
if (method === 'CONNECT') {
|
if (method === 'CONNECT') {
|
||||||
session.ref()
|
session.ref()
|
||||||
|
// We are already connected, streams are pending, first request
|
||||||
|
// will create a new stream. We trigger a request to create the stream and wait until
|
||||||
|
// `ready` event is triggered
|
||||||
// We disabled endStream to allow the user to write to the stream
|
// We disabled endStream to allow the user to write to the stream
|
||||||
stream = session.request(headers, { endStream: false, signal })
|
stream = session.request(headers, { endStream: false, signal })
|
||||||
let upgradeResponseFinished = false
|
|
||||||
|
|
||||||
/**
|
if (stream.id && !stream.pending) {
|
||||||
* @param {import('node:http2').IncomingHttpHeaders} headers
|
|
||||||
*/
|
|
||||||
const onResponse = (headers) => {
|
|
||||||
upgradeResponseFinished = true
|
|
||||||
stream.off(errorMonitor, onUpgradeError)
|
|
||||||
request.onUpgradeResponse(Number(headers[HTTP2_HEADER_STATUS]), headers, parseH2ResponseHeaders)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Error} error
|
|
||||||
*/
|
|
||||||
const onUpgradeError = (error) => {
|
|
||||||
upgradeResponseFinished = true
|
|
||||||
stream.off('response', onResponse)
|
|
||||||
request.onUpgradeError(error)
|
|
||||||
}
|
|
||||||
|
|
||||||
const onReady = () => {
|
|
||||||
try {
|
|
||||||
request.onUpgrade(null, null, stream)
|
request.onUpgrade(null, null, stream)
|
||||||
} catch (error) {
|
|
||||||
stream.off('response', onResponse)
|
|
||||||
abort(error)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.aborted) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.off('error', abort)
|
|
||||||
stream.once(errorMonitor, onUpgradeError)
|
|
||||||
client[kQueue][client[kRunningIdx]++] = null
|
|
||||||
}
|
|
||||||
|
|
||||||
stream.once('response', onResponse)
|
|
||||||
stream.once('error', abort)
|
|
||||||
++session[kOpenStreams]
|
++session[kOpenStreams]
|
||||||
onReady()
|
client[kQueue][client[kRunningIdx]++] = null
|
||||||
|
} else {
|
||||||
|
stream.once('ready', () => {
|
||||||
|
request.onUpgrade(null, null, stream)
|
||||||
|
++session[kOpenStreams]
|
||||||
|
client[kQueue][client[kRunningIdx]++] = null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
stream.once('close', () => {
|
stream.once('close', () => {
|
||||||
if (!upgradeResponseFinished && request.completed) {
|
|
||||||
stream.off('response', onResponse)
|
|
||||||
stream.off(errorMonitor, onUpgradeError)
|
|
||||||
request.onUpgradeError(new InformationalError(`HTTP/2: "stream error" received - code ${stream.rstCode}`))
|
|
||||||
}
|
|
||||||
session[kOpenStreams] -= 1
|
session[kOpenStreams] -= 1
|
||||||
if (session[kOpenStreams] === 0) session.unref()
|
if (session[kOpenStreams] === 0) session.unref()
|
||||||
})
|
})
|
||||||
@@ -22748,7 +22611,6 @@ class RetryHandler {
|
|||||||
this.end = null
|
this.end = null
|
||||||
this.etag = null
|
this.etag = null
|
||||||
this.resume = null
|
this.resume = null
|
||||||
this.headersSent = false
|
|
||||||
|
|
||||||
// Handle possible onConnect duplication
|
// Handle possible onConnect duplication
|
||||||
this.handler.onConnect(reason => {
|
this.handler.onConnect(reason => {
|
||||||
@@ -22761,20 +22623,6 @@ class RetryHandler {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
checkpointResponseEnd (headers, resume) {
|
|
||||||
if (this.end == null && this.opts.method !== 'HEAD') {
|
|
||||||
const contentLength = headers['content-length']
|
|
||||||
this.end = contentLength != null ? Number(contentLength) - 1 : null
|
|
||||||
|
|
||||||
assert(
|
|
||||||
this.end == null || Number.isFinite(this.end),
|
|
||||||
'invalid content-length'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.resume = this.end != null ? resume : null
|
|
||||||
}
|
|
||||||
|
|
||||||
onRequestSent () {
|
onRequestSent () {
|
||||||
if (this.handler.onRequestSent) {
|
if (this.handler.onRequestSent) {
|
||||||
this.handler.onRequestSent()
|
this.handler.onRequestSent()
|
||||||
@@ -22863,12 +22711,7 @@ class RetryHandler {
|
|||||||
this.retryCount += 1
|
this.retryCount += 1
|
||||||
|
|
||||||
if (statusCode >= 300) {
|
if (statusCode >= 300) {
|
||||||
// Only expose a response if no earlier attempt has reached the caller.
|
if (this.retryOpts.statusCodes.includes(statusCode) === false) {
|
||||||
// Otherwise abort this attempt so the error settles the existing body
|
|
||||||
// instead of replacing it with a new response.
|
|
||||||
if (!this.headersSent && this.retryOpts.statusCodes.includes(statusCode) === false) {
|
|
||||||
this.headersSent = true
|
|
||||||
this.checkpointResponseEnd(headers, resume)
|
|
||||||
return this.handler.onHeaders(
|
return this.handler.onHeaders(
|
||||||
statusCode,
|
statusCode,
|
||||||
rawHeaders,
|
rawHeaders,
|
||||||
@@ -22937,15 +22780,8 @@ class RetryHandler {
|
|||||||
|
|
||||||
const { start, size, end = size - 1 } = contentRange
|
const { start, size, end = size - 1 } = contentRange
|
||||||
|
|
||||||
if (this.start !== start || (this.end != null && this.end !== end)) {
|
assert(this.start === start, 'content-range mismatch')
|
||||||
this.abort(
|
assert(this.end == null || this.end === end, 'content-range mismatch')
|
||||||
new RequestRetryError('Content-Range mismatch', statusCode, {
|
|
||||||
headers,
|
|
||||||
data: { count: this.retryCount }
|
|
||||||
})
|
|
||||||
)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
this.resume = resume
|
this.resume = resume
|
||||||
return true
|
return true
|
||||||
@@ -22957,7 +22793,6 @@ class RetryHandler {
|
|||||||
const range = parseRangeHeader(headers['content-range'])
|
const range = parseRangeHeader(headers['content-range'])
|
||||||
|
|
||||||
if (range == null) {
|
if (range == null) {
|
||||||
this.headersSent = true
|
|
||||||
return this.handler.onHeaders(
|
return this.handler.onHeaders(
|
||||||
statusCode,
|
statusCode,
|
||||||
rawHeaders,
|
rawHeaders,
|
||||||
@@ -22996,7 +22831,6 @@ class RetryHandler {
|
|||||||
)
|
)
|
||||||
|
|
||||||
this.resume = resume
|
this.resume = resume
|
||||||
this.headersSent = true
|
|
||||||
this.etag = headers.etag != null ? headers.etag : null
|
this.etag = headers.etag != null ? headers.etag : null
|
||||||
|
|
||||||
// Weak etags are not useful for comparison nor cache
|
// Weak etags are not useful for comparison nor cache
|
||||||
@@ -23036,7 +22870,7 @@ class RetryHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onError (err) {
|
onError (err) {
|
||||||
if (this.aborted || isDisturbed(this.opts.body) || (this.headersSent && this.resume == null)) {
|
if (this.aborted || isDisturbed(this.opts.body)) {
|
||||||
return this.handler.onError(err)
|
return this.handler.onError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27494,49 +27328,6 @@ const COLON = 0x3A
|
|||||||
*/
|
*/
|
||||||
const SPACE = 0x20
|
const SPACE = 0x20
|
||||||
|
|
||||||
const DATA = Buffer.from('data')
|
|
||||||
const EVENT = Buffer.from('event')
|
|
||||||
const ID = Buffer.from('id')
|
|
||||||
const RETRY = Buffer.from('retry')
|
|
||||||
|
|
||||||
function isASCIINumberBytes (buffer, start) {
|
|
||||||
if (start >= buffer.length) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = start; i < buffer.length; i++) {
|
|
||||||
if (buffer[i] < 0x30 || buffer[i] > 0x39) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
function isValidLastEventIdBytes (buffer, start) {
|
|
||||||
for (let i = start; i < buffer.length; i++) {
|
|
||||||
if (buffer[i] === 0x00) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
function isFieldName (line, length, field) {
|
|
||||||
if (length !== field.length) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < length; i++) {
|
|
||||||
if (line[i] !== field[i]) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} EventSourceStreamEvent
|
* @typedef {object} EventSourceStreamEvent
|
||||||
* @type {object}
|
* @type {object}
|
||||||
@@ -27577,14 +27368,11 @@ class EventSourceStream extends Transform {
|
|||||||
eventEndCheck = false
|
eventEndCheck = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Buffer[]}
|
* @type {Buffer}
|
||||||
*/
|
*/
|
||||||
chunks = []
|
buffer = null
|
||||||
|
|
||||||
chunkIndex = 0
|
|
||||||
pos = 0
|
pos = 0
|
||||||
lineChunkIndex = 0
|
|
||||||
linePos = 0
|
|
||||||
|
|
||||||
event = {
|
event = {
|
||||||
data: undefined,
|
data: undefined,
|
||||||
@@ -27623,20 +27411,92 @@ class EventSourceStream extends Transform {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chunks.push(chunk)
|
// Cache the chunk in the buffer, as the data might not be complete while
|
||||||
|
// processing it
|
||||||
|
// TODO: Investigate if there is a more performant way to handle
|
||||||
|
// incoming chunks
|
||||||
|
// see: https://github.com/nodejs/undici/issues/2630
|
||||||
|
if (this.buffer) {
|
||||||
|
this.buffer = Buffer.concat([this.buffer, chunk])
|
||||||
|
} else {
|
||||||
|
this.buffer = chunk
|
||||||
|
}
|
||||||
|
|
||||||
// Strip leading byte-order-mark if we opened the stream and started
|
// Strip leading byte-order-mark if we opened the stream and started
|
||||||
// the processing of the incoming data
|
// the processing of the incoming data
|
||||||
if (this.checkBOM) {
|
if (this.checkBOM) {
|
||||||
if (this.handleBOM()) {
|
switch (this.buffer.length) {
|
||||||
|
case 1:
|
||||||
|
// Check if the first byte is the same as the first byte of the BOM
|
||||||
|
if (this.buffer[0] === BOM[0]) {
|
||||||
|
// If it is, we need to wait for more data
|
||||||
callback()
|
callback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
|
// BOM anymore
|
||||||
|
this.checkBOM = false
|
||||||
|
|
||||||
|
// The buffer only contains one byte so we need to wait for more data
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
case 2:
|
||||||
|
// Check if the first two bytes are the same as the first two bytes
|
||||||
|
// of the BOM
|
||||||
|
if (
|
||||||
|
this.buffer[0] === BOM[0] &&
|
||||||
|
this.buffer[1] === BOM[1]
|
||||||
|
) {
|
||||||
|
// If it is, we need to wait for more data, because the third byte
|
||||||
|
// is needed to determine if it is the BOM or not
|
||||||
|
callback()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
while (this.hasCurrentByte()) {
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
const byte = this.currentByte()
|
// BOM anymore
|
||||||
|
this.checkBOM = false
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
// Check if the first three bytes are the same as the first three
|
||||||
|
// bytes of the BOM
|
||||||
|
if (
|
||||||
|
this.buffer[0] === BOM[0] &&
|
||||||
|
this.buffer[1] === BOM[1] &&
|
||||||
|
this.buffer[2] === BOM[2]
|
||||||
|
) {
|
||||||
|
// If it is, we can drop the buffered data, as it is only the BOM
|
||||||
|
this.buffer = Buffer.alloc(0)
|
||||||
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
|
// BOM anymore
|
||||||
|
this.checkBOM = false
|
||||||
|
|
||||||
|
// Await more data
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// If it is not the BOM, we can start processing the data
|
||||||
|
this.checkBOM = false
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
// The buffer is longer than 3 bytes, so we can drop the BOM if it is
|
||||||
|
// present
|
||||||
|
if (
|
||||||
|
this.buffer[0] === BOM[0] &&
|
||||||
|
this.buffer[1] === BOM[1] &&
|
||||||
|
this.buffer[2] === BOM[2]
|
||||||
|
) {
|
||||||
|
// Remove the BOM from the buffer
|
||||||
|
this.buffer = this.buffer.subarray(3)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the checkBOM flag to false as we don't need to check for the
|
||||||
|
this.checkBOM = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (this.pos < this.buffer.length) {
|
||||||
// If the previous line ended with an end-of-line, we need to check
|
// If the previous line ended with an end-of-line, we need to check
|
||||||
// if the next character is also an end-of-line.
|
// if the next character is also an end-of-line.
|
||||||
if (this.eventEndCheck) {
|
if (this.eventEndCheck) {
|
||||||
@@ -27649,9 +27509,10 @@ class EventSourceStream extends Transform {
|
|||||||
if (this.crlfCheck) {
|
if (this.crlfCheck) {
|
||||||
// If the current character is a line feed, we can remove it
|
// If the current character is a line feed, we can remove it
|
||||||
// from the buffer and reset the crlfCheck flag
|
// from the buffer and reset the crlfCheck flag
|
||||||
if (byte === LF) {
|
if (this.buffer[this.pos] === LF) {
|
||||||
|
this.buffer = this.buffer.subarray(this.pos + 1)
|
||||||
|
this.pos = 0
|
||||||
this.crlfCheck = false
|
this.crlfCheck = false
|
||||||
this.consumeCurrentByte()
|
|
||||||
|
|
||||||
// It is possible that the line feed is not the end of the
|
// It is possible that the line feed is not the end of the
|
||||||
// event. We need to check if the next character is an
|
// event. We need to check if the next character is an
|
||||||
@@ -27667,17 +27528,19 @@ class EventSourceStream extends Transform {
|
|||||||
this.crlfCheck = false
|
this.crlfCheck = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (byte === LF || byte === CR) {
|
if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
|
||||||
// If the current character is a carriage return, we need to
|
// If the current character is a carriage return, we need to
|
||||||
// set the crlfCheck flag to true, as we need to check if the
|
// set the crlfCheck flag to true, as we need to check if the
|
||||||
// next character is a line feed so we can remove it from the
|
// next character is a line feed so we can remove it from the
|
||||||
// buffer
|
// buffer
|
||||||
if (byte === CR) {
|
if (this.buffer[this.pos] === CR) {
|
||||||
this.crlfCheck = true
|
this.crlfCheck = true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.consumeCurrentByte()
|
this.buffer = this.buffer.subarray(this.pos + 1)
|
||||||
if (this.hasPendingEvent()) {
|
this.pos = 0
|
||||||
|
if (
|
||||||
|
this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {
|
||||||
this.processEvent(this.event)
|
this.processEvent(this.event)
|
||||||
}
|
}
|
||||||
this.clearEvent()
|
this.clearEvent()
|
||||||
@@ -27691,18 +27554,22 @@ class EventSourceStream extends Transform {
|
|||||||
|
|
||||||
// If the current character is an end-of-line, we can process the
|
// If the current character is an end-of-line, we can process the
|
||||||
// line
|
// line
|
||||||
if (byte === LF || byte === CR) {
|
if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
|
||||||
// If the current character is a carriage return, we need to
|
// If the current character is a carriage return, we need to
|
||||||
// set the crlfCheck flag to true, as we need to check if the
|
// set the crlfCheck flag to true, as we need to check if the
|
||||||
// next character is a line feed
|
// next character is a line feed
|
||||||
if (byte === CR) {
|
if (this.buffer[this.pos] === CR) {
|
||||||
this.crlfCheck = true
|
this.crlfCheck = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// In any case, we can process the line as we reached an
|
// In any case, we can process the line as we reached an
|
||||||
// end-of-line character
|
// end-of-line character
|
||||||
this.parseLine(this.readLine(), this.event)
|
this.parseLine(this.buffer.subarray(0, this.pos), this.event)
|
||||||
this.consumeCurrentByte()
|
|
||||||
|
// Remove the processed line from the buffer
|
||||||
|
this.buffer = this.buffer.subarray(this.pos + 1)
|
||||||
|
// Reset the position as we removed the processed line from the buffer
|
||||||
|
this.pos = 0
|
||||||
// A line was processed and this could be the end of the event. We need
|
// A line was processed and this could be the end of the event. We need
|
||||||
// to check if the next line is empty to determine if the event is
|
// to check if the next line is empty to determine if the event is
|
||||||
// finished.
|
// finished.
|
||||||
@@ -27710,7 +27577,7 @@ class EventSourceStream extends Transform {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
this.advanceCursor()
|
this.pos++
|
||||||
}
|
}
|
||||||
|
|
||||||
callback()
|
callback()
|
||||||
@@ -27735,53 +27602,64 @@ class EventSourceStream extends Transform {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let fieldLength = line.length
|
let field = ''
|
||||||
let valueStart = line.length
|
let value = ''
|
||||||
|
|
||||||
// If the line contains a U+003A COLON character (:)
|
// If the line contains a U+003A COLON character (:)
|
||||||
if (colonPosition !== -1) {
|
if (colonPosition !== -1) {
|
||||||
fieldLength = colonPosition
|
// Collect the characters on the line before the first U+003A COLON
|
||||||
|
// character (:), and let field be that string.
|
||||||
|
// TODO: Investigate if there is a more performant way to extract the
|
||||||
|
// field
|
||||||
|
// see: https://github.com/nodejs/undici/issues/2630
|
||||||
|
field = line.subarray(0, colonPosition).toString('utf8')
|
||||||
|
|
||||||
// Collect the characters on the line after the first U+003A COLON
|
// Collect the characters on the line after the first U+003A COLON
|
||||||
// character (:), and let value be that string.
|
// character (:), and let value be that string.
|
||||||
// If value starts with a U+0020 SPACE character, remove it from value.
|
// If value starts with a U+0020 SPACE character, remove it from value.
|
||||||
valueStart = colonPosition + 1
|
let valueStart = colonPosition + 1
|
||||||
if (line[valueStart] === SPACE) {
|
if (line[valueStart] === SPACE) {
|
||||||
++valueStart
|
++valueStart
|
||||||
}
|
}
|
||||||
}
|
// TODO: Investigate if there is a more performant way to extract the
|
||||||
|
// value
|
||||||
|
// see: https://github.com/nodejs/undici/issues/2630
|
||||||
|
value = line.subarray(valueStart).toString('utf8')
|
||||||
|
|
||||||
if (isFieldName(line, fieldLength, DATA)) {
|
// Otherwise, the string is not empty but does not contain a U+003A COLON
|
||||||
const value = line.toString('utf8', valueStart)
|
// character (:)
|
||||||
|
|
||||||
if (event.data === undefined) {
|
|
||||||
event.data = value
|
|
||||||
} else {
|
} else {
|
||||||
event.data += `\n${value}`
|
// Process the field using the steps described below, using the whole
|
||||||
}
|
// line as the field name, and the empty string as the field value.
|
||||||
return
|
field = line.toString('utf8')
|
||||||
|
value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFieldName(line, fieldLength, RETRY)) {
|
// Modify the event with the field name and value. The value is also
|
||||||
if (isASCIINumberBytes(line, valueStart)) {
|
// decoded as UTF-8
|
||||||
event.retry = line.toString('utf8', valueStart)
|
switch (field) {
|
||||||
|
case 'data':
|
||||||
|
if (event[field] === undefined) {
|
||||||
|
event[field] = value
|
||||||
|
} else {
|
||||||
|
event[field] += `\n${value}`
|
||||||
}
|
}
|
||||||
return
|
break
|
||||||
|
case 'retry':
|
||||||
|
if (isASCIINumber(value)) {
|
||||||
|
event[field] = value
|
||||||
}
|
}
|
||||||
|
break
|
||||||
if (isFieldName(line, fieldLength, ID)) {
|
case 'id':
|
||||||
if (isValidLastEventIdBytes(line, valueStart)) {
|
if (isValidLastEventId(value)) {
|
||||||
event.id = line.toString('utf8', valueStart)
|
event[field] = value
|
||||||
}
|
}
|
||||||
return
|
break
|
||||||
}
|
case 'event':
|
||||||
|
|
||||||
if (isFieldName(line, fieldLength, EVENT)) {
|
|
||||||
const value = line.toString('utf8', valueStart)
|
|
||||||
|
|
||||||
if (value.length > 0) {
|
if (value.length > 0) {
|
||||||
event.event = value
|
event[field] = value
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27811,151 +27689,12 @@ class EventSourceStream extends Transform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearEvent () {
|
clearEvent () {
|
||||||
this.event.data = undefined
|
this.event = {
|
||||||
this.event.event = undefined
|
data: undefined,
|
||||||
this.event.id = undefined
|
event: undefined,
|
||||||
this.event.retry = undefined
|
id: undefined,
|
||||||
|
retry: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
hasPendingEvent () {
|
|
||||||
return this.event.data !== undefined ||
|
|
||||||
this.event.event !== undefined ||
|
|
||||||
this.event.id !== undefined ||
|
|
||||||
this.event.retry !== undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
hasCurrentByte () {
|
|
||||||
return this.chunkIndex < this.chunks.length &&
|
|
||||||
this.pos < this.chunks[this.chunkIndex].length
|
|
||||||
}
|
|
||||||
|
|
||||||
currentByte () {
|
|
||||||
return this.chunks[this.chunkIndex][this.pos]
|
|
||||||
}
|
|
||||||
|
|
||||||
consumeCurrentByte () {
|
|
||||||
this.advanceCursor()
|
|
||||||
this.syncLineStartToCursor()
|
|
||||||
}
|
|
||||||
|
|
||||||
advanceCursor () {
|
|
||||||
this.pos++
|
|
||||||
|
|
||||||
while (this.chunkIndex < this.chunks.length && this.pos >= this.chunks[this.chunkIndex].length) {
|
|
||||||
this.chunkIndex++
|
|
||||||
this.pos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
syncLineStartToCursor () {
|
|
||||||
this.lineChunkIndex = this.chunkIndex
|
|
||||||
this.linePos = this.pos
|
|
||||||
this.dropConsumedChunks()
|
|
||||||
}
|
|
||||||
|
|
||||||
dropConsumedChunks () {
|
|
||||||
while (this.lineChunkIndex > 0) {
|
|
||||||
this.chunks.shift()
|
|
||||||
this.lineChunkIndex--
|
|
||||||
this.chunkIndex--
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.chunkIndex === this.chunks.length) {
|
|
||||||
this.chunks.length = 0
|
|
||||||
this.chunkIndex = 0
|
|
||||||
this.pos = 0
|
|
||||||
this.lineChunkIndex = 0
|
|
||||||
this.linePos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readLine () {
|
|
||||||
if (this.lineChunkIndex === this.chunkIndex) {
|
|
||||||
return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos)
|
|
||||||
}
|
|
||||||
|
|
||||||
const chunks = []
|
|
||||||
let length = 0
|
|
||||||
|
|
||||||
for (let i = this.lineChunkIndex; i <= this.chunkIndex; i++) {
|
|
||||||
const chunk = this.chunks[i]
|
|
||||||
const start = i === this.lineChunkIndex ? this.linePos : 0
|
|
||||||
const end = i === this.chunkIndex ? this.pos : chunk.length
|
|
||||||
const slice = chunk.subarray(start, end)
|
|
||||||
length += slice.length
|
|
||||||
chunks.push(slice)
|
|
||||||
}
|
|
||||||
|
|
||||||
return Buffer.concat(chunks, length)
|
|
||||||
}
|
|
||||||
|
|
||||||
peekBufferedByte (offset) {
|
|
||||||
let chunkIndex = this.lineChunkIndex
|
|
||||||
let pos = this.linePos
|
|
||||||
|
|
||||||
while (chunkIndex < this.chunks.length) {
|
|
||||||
const chunk = this.chunks[chunkIndex]
|
|
||||||
const remaining = chunk.length - pos
|
|
||||||
|
|
||||||
if (offset < remaining) {
|
|
||||||
return chunk[pos + offset]
|
|
||||||
}
|
|
||||||
|
|
||||||
offset -= remaining
|
|
||||||
chunkIndex++
|
|
||||||
pos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
discardLeadingBytes (count) {
|
|
||||||
while (count > 0 && this.lineChunkIndex < this.chunks.length) {
|
|
||||||
const chunk = this.chunks[this.lineChunkIndex]
|
|
||||||
const remaining = chunk.length - this.linePos
|
|
||||||
|
|
||||||
if (count < remaining) {
|
|
||||||
this.linePos += count
|
|
||||||
count = 0
|
|
||||||
} else {
|
|
||||||
count -= remaining
|
|
||||||
this.lineChunkIndex++
|
|
||||||
this.linePos = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.chunkIndex = this.lineChunkIndex
|
|
||||||
this.pos = this.linePos
|
|
||||||
this.dropConsumedChunks()
|
|
||||||
}
|
|
||||||
|
|
||||||
handleBOM () {
|
|
||||||
const first = this.peekBufferedByte(0)
|
|
||||||
const second = this.peekBufferedByte(1)
|
|
||||||
const third = this.peekBufferedByte(2)
|
|
||||||
|
|
||||||
if (second === undefined) {
|
|
||||||
if (first === BOM[0]) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.checkBOM = false
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (third === undefined) {
|
|
||||||
if (first === BOM[0] && second === BOM[1]) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
this.checkBOM = false
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (first === BOM[0] && second === BOM[1] && third === BOM[2]) {
|
|
||||||
this.discardLeadingBytes(3)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.checkBOM = false
|
|
||||||
return !this.hasCurrentByte()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39224,7 +38963,7 @@ function establishWebSocketConnection (url, protocols, client, ws, onEstablish,
|
|||||||
// is specified, the server needs to include the same field and one of
|
// is specified, the server needs to include the same field and one of
|
||||||
// the selected subprotocol values in its response for the connection to
|
// the selected subprotocol values in its response for the connection to
|
||||||
// be established.
|
// be established.
|
||||||
if (requestProtocols === null || !requestProtocols.includes(secProtocol)) {
|
if (!requestProtocols.includes(secProtocol)) {
|
||||||
failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
|
failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -39985,12 +39724,7 @@ class PerMessageDeflate {
|
|||||||
|
|
||||||
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
|
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
|
||||||
callback(new MessageSizeExceededError())
|
callback(new MessageSizeExceededError())
|
||||||
// The inflater may still hold buffered input that can emit a late
|
|
||||||
// zlib error. Remove the data listener, then deterministically stop
|
|
||||||
// the stream so a subsequent 'error' cannot fire without a listener
|
|
||||||
// (which would terminate the process as an unhandled error event).
|
|
||||||
this.#inflate.removeAllListeners()
|
this.#inflate.removeAllListeners()
|
||||||
this.#inflate.destroy()
|
|
||||||
this.#inflate = null
|
this.#inflate = null
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
192
package-lock.json
generated
192
package-lock.json
generated
@@ -28,9 +28,9 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
||||||
"@typescript-eslint/parser": "^8.62.0",
|
"@typescript-eslint/parser": "^8.62.0",
|
||||||
"@vercel/ncc": "^0.44.0",
|
"@vercel/ncc": "^0.44.0",
|
||||||
"eslint": "^10.5.0",
|
"eslint": "^10.11.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-jest": "^29.15.2",
|
"eslint-plugin-jest": "^29.16.6",
|
||||||
"eslint-plugin-n": "^18.1.0",
|
"eslint-plugin-n": "^18.1.0",
|
||||||
"globals": "^17.7.0",
|
"globals": "^17.7.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
@@ -884,6 +884,30 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/@cacheable/memory": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@cacheable/utils": "^2.5.0",
|
||||||
|
"@keyv/bigmap": "^1.3.1",
|
||||||
|
"hookified": "^1.15.1",
|
||||||
|
"keyv": "^5.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@cacheable/utils": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"hashery": "^1.5.1",
|
||||||
|
"keyv": "^5.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@emnapi/core": {
|
"node_modules/@emnapi/core": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
|
||||||
@@ -979,9 +1003,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-helpers": {
|
"node_modules/@eslint/config-helpers": {
|
||||||
"version": "0.6.0",
|
"version": "0.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz",
|
||||||
"integrity": "sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==",
|
"integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1036,9 +1060,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/plugin-kit": {
|
"node_modules/@eslint/plugin-kit": {
|
||||||
"version": "0.7.2",
|
"version": "0.7.3",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz",
|
||||||
"integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==",
|
"integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -1614,6 +1638,30 @@
|
|||||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@keyv/bigmap": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"hashery": "^1.4.0",
|
||||||
|
"hookified": "^1.15.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"keyv": "^5.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@keyv/serialize": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@napi-rs/wasm-runtime": {
|
"node_modules/@napi-rs/wasm-runtime": {
|
||||||
"version": "1.1.5",
|
"version": "1.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz",
|
||||||
@@ -2913,6 +2961,20 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/cacheable": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@cacheable/memory": "^2.2.0",
|
||||||
|
"@cacheable/utils": "^2.5.0",
|
||||||
|
"hookified": "^1.15.0",
|
||||||
|
"keyv": "^5.6.0",
|
||||||
|
"qified": "^0.10.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/callsites": {
|
"node_modules/callsites": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||||
@@ -3295,9 +3357,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "10.5.0",
|
"version": "10.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.11.0.tgz",
|
||||||
"integrity": "sha512-1y+7C+vi12bUK1IpZeaV3gsH9fHLBmPvYmPx42pvT/E9yG0IC8g3PUZZgp0+JLJl7ZDK0flc2gc+Aw9dpCvIsQ==",
|
"integrity": "sha512-P7a6UEEqb9G95MYAtqkmsTbVXIYyzIfl6NGOIJk162PaahFxFyeGcrlXYFSiagECg4sEm8IseJdZBKR3rx6MsQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
@@ -3307,9 +3369,9 @@
|
|||||||
"@eslint-community/eslint-utils": "^4.8.0",
|
"@eslint-community/eslint-utils": "^4.8.0",
|
||||||
"@eslint-community/regexpp": "^4.12.2",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@eslint/config-array": "^0.23.5",
|
"@eslint/config-array": "^0.23.5",
|
||||||
"@eslint/config-helpers": "^0.6.0",
|
"@eslint/config-helpers": "^0.7.0",
|
||||||
"@eslint/core": "^1.2.1",
|
"@eslint/core": "^1.2.1",
|
||||||
"@eslint/plugin-kit": "^0.7.2",
|
"@eslint/plugin-kit": "^0.7.3",
|
||||||
"@humanfs/node": "^0.16.6",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@humanwhocodes/retry": "^0.4.2",
|
"@humanwhocodes/retry": "^0.4.2",
|
||||||
@@ -3324,14 +3386,14 @@
|
|||||||
"esquery": "^1.7.0",
|
"esquery": "^1.7.0",
|
||||||
"esutils": "^2.0.2",
|
"esutils": "^2.0.2",
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"file-entry-cache": "^8.0.0",
|
"file-entry-cache": "11.1.5 || >11.1.6 <12",
|
||||||
"find-up": "^5.0.0",
|
"find-up": "^5.0.0",
|
||||||
"glob-parent": "^6.0.2",
|
"glob-parent": "^6.0.2",
|
||||||
"ignore": "^5.2.0",
|
"ignore": "^5.2.0",
|
||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
"is-glob": "^4.0.0",
|
"is-glob": "^4.0.0",
|
||||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||||
"minimatch": "^10.2.4",
|
"minimatch": "^10.2.5",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
"optionator": "^0.9.3"
|
"optionator": "^0.9.3"
|
||||||
},
|
},
|
||||||
@@ -3408,9 +3470,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-jest": {
|
"node_modules/eslint-plugin-jest": {
|
||||||
"version": "29.15.2",
|
"version": "29.16.6",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.16.6.tgz",
|
||||||
"integrity": "sha512-kEN4r9RZl1xcsb4arGq89LrcVdOUFII/JSCwtTPJyv16mDwmPrcuEQwpxqZHeINvcsd7oK5O/rhdGlxFRaZwvQ==",
|
"integrity": "sha512-q8TVr0rlNvUD0XnafGWkwtPeX+tTl2llP86EDl3sJtwWrQA/JT9SIu2hLLZbhhX6fT5SDE4O0gIKyZUujKnkYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -3423,7 +3485,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"jest": "*",
|
"jest": "*",
|
||||||
"typescript": ">=4.8.4 <7.0.0"
|
"typescript": ">=4.8.4 <8.0.0"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@typescript-eslint/eslint-plugin": {
|
"@typescript-eslint/eslint-plugin": {
|
||||||
@@ -3781,16 +3843,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/file-entry-cache": {
|
"node_modules/file-entry-cache": {
|
||||||
"version": "8.0.0",
|
"version": "11.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-11.1.5.tgz",
|
||||||
"integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
|
"integrity": "sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"flat-cache": "^4.0.0"
|
"flat-cache": "^6.1.23"
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.0.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/find-up": {
|
"node_modules/find-up": {
|
||||||
@@ -3810,23 +3869,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/flat-cache": {
|
"node_modules/flat-cache": {
|
||||||
"version": "4.0.1",
|
"version": "6.1.23",
|
||||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.23.tgz",
|
||||||
"integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
|
"integrity": "sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"flatted": "^3.2.9",
|
"cacheable": "^2.5.0",
|
||||||
"keyv": "^4.5.4"
|
"flatted": "^3.4.2",
|
||||||
},
|
"hookified": "^1.15.0"
|
||||||
"engines": {
|
|
||||||
"node": ">=16"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/flatted": {
|
"node_modules/flatted": {
|
||||||
"version": "3.4.2",
|
"version": "3.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz",
|
||||||
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
|
"integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
@@ -4060,6 +4117,26 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/hashery": {
|
||||||
|
"version": "1.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/hashery/-/hashery-1.5.1.tgz",
|
||||||
|
"integrity": "sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"hookified": "^1.15.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hookified": {
|
||||||
|
"version": "1.15.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.1.tgz",
|
||||||
|
"integrity": "sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/html-escaper": {
|
"node_modules/html-escaper": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
|
||||||
@@ -4995,13 +5072,6 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/json-buffer": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/json-parse-even-better-errors": {
|
"node_modules/json-parse-even-better-errors": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
|
||||||
@@ -5040,13 +5110,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/keyv": {
|
"node_modules/keyv": {
|
||||||
"version": "4.5.4",
|
"version": "5.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz",
|
||||||
"integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
|
"integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"json-buffer": "3.0.1"
|
"@keyv/serialize": "^1.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/leven": {
|
"node_modules/leven": {
|
||||||
@@ -5629,6 +5699,26 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/qified": {
|
||||||
|
"version": "0.10.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/qified/-/qified-0.10.1.tgz",
|
||||||
|
"integrity": "sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"hookified": "^2.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/qified/node_modules/hookified": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/hookified/-/hookified-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/react-is-18": {
|
"node_modules/react-is-18": {
|
||||||
"name": "react-is",
|
"name": "react-is",
|
||||||
"version": "18.3.1",
|
"version": "18.3.1",
|
||||||
@@ -6266,9 +6356,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici": {
|
"node_modules/undici": {
|
||||||
"version": "6.29.0",
|
"version": "6.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz",
|
||||||
"integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==",
|
"integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.17"
|
"node": ">=18.17"
|
||||||
|
|||||||
@@ -49,9 +49,9 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
||||||
"@typescript-eslint/parser": "^8.62.0",
|
"@typescript-eslint/parser": "^8.62.0",
|
||||||
"@vercel/ncc": "^0.44.0",
|
"@vercel/ncc": "^0.44.0",
|
||||||
"eslint": "^10.5.0",
|
"eslint": "^10.11.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-jest": "^29.15.2",
|
"eslint-plugin-jest": "^29.16.6",
|
||||||
"eslint-plugin-n": "^18.1.0",
|
"eslint-plugin-n": "^18.1.0",
|
||||||
"globals": "^17.7.0",
|
"globals": "^17.7.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
|
|||||||
Reference in New Issue
Block a user