mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-09 09:59:45 +07:00
node_modules: update (#328)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
1 parent
23dc752083
commit
0e0ab085a3
10 files changed
+460
-192
No files matched your search
+68
-2
@@ -263,11 +263,77 @@ 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.completed)
|
||||
|
||||
return this[kHandler].onUpgrade(statusCode, headers, socket)
|
||||
if (statusCode !== null) {
|
||||
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) {
|
||||
|
||||
Reference in new issue
Block a user