Dev (#12)
* health check * Update Dockerfile * simplifying the deployment * Update Bot.js makes the find team command public * test (#9) * Dev (#7) * health check * Update Dockerfile * simplifying the deployment * Dev (#8) * health check * Update Dockerfile * simplifying the deployment * Update Bot.js makes the find team command public * Update PlayerService.js * massive update???? could break stuff * Update Bot.js update
This commit is contained in:
15
node_modules/undici/lib/web/fetch/body.js
generated
vendored
15
node_modules/undici/lib/web/fetch/body.js
generated
vendored
@@ -20,6 +20,14 @@ const { isErrored, isDisturbed } = require('node:stream')
|
||||
const { isArrayBuffer } = require('node:util/types')
|
||||
const { serializeAMimeType } = require('./data-url')
|
||||
const { multipartFormDataParser } = require('./formdata-parser')
|
||||
let random
|
||||
|
||||
try {
|
||||
const crypto = require('node:crypto')
|
||||
random = (max) => crypto.randomInt(0, max)
|
||||
} catch {
|
||||
random = (max) => Math.floor(Math.random(max))
|
||||
}
|
||||
|
||||
const textEncoder = new TextEncoder()
|
||||
function noop () {}
|
||||
@@ -113,7 +121,7 @@ function extractBody (object, keepalive = false) {
|
||||
// Set source to a copy of the bytes held by object.
|
||||
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
|
||||
} else if (util.isFormDataLike(object)) {
|
||||
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
|
||||
const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
|
||||
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
|
||||
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
||||
@@ -154,7 +162,10 @@ function extractBody (object, keepalive = false) {
|
||||
}
|
||||
}
|
||||
|
||||
const chunk = textEncoder.encode(`--${boundary}--`)
|
||||
// CRLF is appended to the body to function with legacy servers and match other implementations.
|
||||
// https://github.com/curl/curl/blob/3434c6b46e682452973972e8313613dfa58cd690/lib/mime.c#L1029-L1030
|
||||
// https://github.com/form-data/form-data/issues/63
|
||||
const chunk = textEncoder.encode(`--${boundary}--\r\n`)
|
||||
blobParts.push(chunk)
|
||||
length += chunk.byteLength
|
||||
if (hasUnknownSizeValue) {
|
||||
|
||||
61
node_modules/undici/lib/web/fetch/constants.js
generated
vendored
61
node_modules/undici/lib/web/fetch/constants.js
generated
vendored
@@ -1,27 +1,30 @@
|
||||
'use strict'
|
||||
|
||||
const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
|
||||
const corsSafeListedMethods = /** @type {const} */ (['GET', 'HEAD', 'POST'])
|
||||
const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
|
||||
|
||||
const nullBodyStatus = [101, 204, 205, 304]
|
||||
const nullBodyStatus = /** @type {const} */ ([101, 204, 205, 304])
|
||||
|
||||
const redirectStatus = [301, 302, 303, 307, 308]
|
||||
const redirectStatus = /** @type {const} */ ([301, 302, 303, 307, 308])
|
||||
const redirectStatusSet = new Set(redirectStatus)
|
||||
|
||||
// https://fetch.spec.whatwg.org/#block-bad-port
|
||||
const badPorts = [
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#block-bad-port
|
||||
*/
|
||||
const badPorts = /** @type {const} */ ([
|
||||
'1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
|
||||
'87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
|
||||
'139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
|
||||
'540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
|
||||
'2049', '3659', '4045', '4190', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6679',
|
||||
'6697', '10080'
|
||||
]
|
||||
|
||||
])
|
||||
const badPortsSet = new Set(badPorts)
|
||||
|
||||
// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
|
||||
const referrerPolicy = [
|
||||
/**
|
||||
* @see https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
|
||||
*/
|
||||
const referrerPolicy = /** @type {const} */ ([
|
||||
'',
|
||||
'no-referrer',
|
||||
'no-referrer-when-downgrade',
|
||||
@@ -31,29 +34,31 @@ const referrerPolicy = [
|
||||
'origin-when-cross-origin',
|
||||
'strict-origin-when-cross-origin',
|
||||
'unsafe-url'
|
||||
]
|
||||
])
|
||||
const referrerPolicySet = new Set(referrerPolicy)
|
||||
|
||||
const requestRedirect = ['follow', 'manual', 'error']
|
||||
const requestRedirect = /** @type {const} */ (['follow', 'manual', 'error'])
|
||||
|
||||
const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
|
||||
const safeMethods = /** @type {const} */ (['GET', 'HEAD', 'OPTIONS', 'TRACE'])
|
||||
const safeMethodsSet = new Set(safeMethods)
|
||||
|
||||
const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
|
||||
const requestMode = /** @type {const} */ (['navigate', 'same-origin', 'no-cors', 'cors'])
|
||||
|
||||
const requestCredentials = ['omit', 'same-origin', 'include']
|
||||
const requestCredentials = /** @type {const} */ (['omit', 'same-origin', 'include'])
|
||||
|
||||
const requestCache = [
|
||||
const requestCache = /** @type {const} */ ([
|
||||
'default',
|
||||
'no-store',
|
||||
'reload',
|
||||
'no-cache',
|
||||
'force-cache',
|
||||
'only-if-cached'
|
||||
]
|
||||
])
|
||||
|
||||
// https://fetch.spec.whatwg.org/#request-body-header-name
|
||||
const requestBodyHeader = [
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#request-body-header-name
|
||||
*/
|
||||
const requestBodyHeader = /** @type {const} */ ([
|
||||
'content-encoding',
|
||||
'content-language',
|
||||
'content-location',
|
||||
@@ -63,18 +68,22 @@ const requestBodyHeader = [
|
||||
// removed in the Headers implementation. However, undici doesn't
|
||||
// filter out headers, so we add it here.
|
||||
'content-length'
|
||||
]
|
||||
])
|
||||
|
||||
// https://fetch.spec.whatwg.org/#enumdef-requestduplex
|
||||
const requestDuplex = [
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#enumdef-requestduplex
|
||||
*/
|
||||
const requestDuplex = /** @type {const} */ ([
|
||||
'half'
|
||||
]
|
||||
])
|
||||
|
||||
// http://fetch.spec.whatwg.org/#forbidden-method
|
||||
const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
|
||||
/**
|
||||
* @see http://fetch.spec.whatwg.org/#forbidden-method
|
||||
*/
|
||||
const forbiddenMethods = /** @type {const} */ (['CONNECT', 'TRACE', 'TRACK'])
|
||||
const forbiddenMethodsSet = new Set(forbiddenMethods)
|
||||
|
||||
const subresource = [
|
||||
const subresource = /** @type {const} */ ([
|
||||
'audio',
|
||||
'audioworklet',
|
||||
'font',
|
||||
@@ -87,7 +96,7 @@ const subresource = [
|
||||
'video',
|
||||
'xslt',
|
||||
''
|
||||
]
|
||||
])
|
||||
const subresourceSet = new Set(subresource)
|
||||
|
||||
module.exports = {
|
||||
|
||||
14
node_modules/undici/lib/web/fetch/formdata-parser.js
generated
vendored
14
node_modules/undici/lib/web/fetch/formdata-parser.js
generated
vendored
@@ -87,11 +87,21 @@ function multipartFormDataParser (input, mimeType) {
|
||||
// the first byte.
|
||||
const position = { position: 0 }
|
||||
|
||||
// Note: undici addition, allow \r\n before the body.
|
||||
if (input[0] === 0x0d && input[1] === 0x0a) {
|
||||
// Note: undici addition, allows leading and trailing CRLFs.
|
||||
while (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {
|
||||
position.position += 2
|
||||
}
|
||||
|
||||
let trailing = input.length
|
||||
|
||||
while (input[trailing - 1] === 0x0a && input[trailing - 2] === 0x0d) {
|
||||
trailing -= 2
|
||||
}
|
||||
|
||||
if (trailing !== input.length) {
|
||||
input = input.subarray(0, trailing)
|
||||
}
|
||||
|
||||
// 5. While true:
|
||||
while (true) {
|
||||
// 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D
|
||||
|
||||
2
node_modules/undici/lib/web/fetch/formdata.js
generated
vendored
2
node_modules/undici/lib/web/fetch/formdata.js
generated
vendored
@@ -14,6 +14,8 @@ const File = globalThis.File ?? NativeFile
|
||||
// https://xhr.spec.whatwg.org/#formdata
|
||||
class FormData {
|
||||
constructor (form) {
|
||||
webidl.util.markAsUncloneable(this)
|
||||
|
||||
if (form !== undefined) {
|
||||
throw webidl.errors.conversionFailed({
|
||||
prefix: 'FormData constructor',
|
||||
|
||||
2
node_modules/undici/lib/web/fetch/headers.js
generated
vendored
2
node_modules/undici/lib/web/fetch/headers.js
generated
vendored
@@ -359,6 +359,8 @@ class Headers {
|
||||
#headersList
|
||||
|
||||
constructor (init = undefined) {
|
||||
webidl.util.markAsUncloneable(this)
|
||||
|
||||
if (init === kConstruct) {
|
||||
return
|
||||
}
|
||||
|
||||
22
node_modules/undici/lib/web/fetch/index.js
generated
vendored
22
node_modules/undici/lib/web/fetch/index.js
generated
vendored
@@ -2137,7 +2137,7 @@ async function httpNetworkFetch (
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
||||
if (codings.length !== 0 && request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
|
||||
for (let i = 0; i < codings.length; ++i) {
|
||||
for (let i = codings.length - 1; i >= 0; --i) {
|
||||
const coding = codings[i]
|
||||
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
|
||||
if (coding === 'x-gzip' || coding === 'gzip') {
|
||||
@@ -2150,9 +2150,15 @@ async function httpNetworkFetch (
|
||||
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
||||
}))
|
||||
} else if (coding === 'deflate') {
|
||||
decoders.push(createInflate())
|
||||
decoders.push(createInflate({
|
||||
flush: zlib.constants.Z_SYNC_FLUSH,
|
||||
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
||||
}))
|
||||
} else if (coding === 'br') {
|
||||
decoders.push(zlib.createBrotliDecompress())
|
||||
decoders.push(zlib.createBrotliDecompress({
|
||||
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
||||
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
||||
}))
|
||||
} else {
|
||||
decoders.length = 0
|
||||
break
|
||||
@@ -2160,13 +2166,19 @@ async function httpNetworkFetch (
|
||||
}
|
||||
}
|
||||
|
||||
const onError = this.onError.bind(this)
|
||||
|
||||
resolve({
|
||||
status,
|
||||
statusText,
|
||||
headersList,
|
||||
body: decoders.length
|
||||
? pipeline(this.body, ...decoders, () => { })
|
||||
: this.body.on('error', () => { })
|
||||
? pipeline(this.body, ...decoders, (err) => {
|
||||
if (err) {
|
||||
this.onError(err)
|
||||
}
|
||||
}).on('error', onError)
|
||||
: this.body.on('error', onError)
|
||||
})
|
||||
|
||||
return true
|
||||
|
||||
1
node_modules/undici/lib/web/fetch/request.js
generated
vendored
1
node_modules/undici/lib/web/fetch/request.js
generated
vendored
@@ -82,6 +82,7 @@ let patchMethodWarning = false
|
||||
class Request {
|
||||
// https://fetch.spec.whatwg.org/#dom-request
|
||||
constructor (input, init = {}) {
|
||||
webidl.util.markAsUncloneable(this)
|
||||
if (input === kConstruct) {
|
||||
return
|
||||
}
|
||||
|
||||
1
node_modules/undici/lib/web/fetch/response.js
generated
vendored
1
node_modules/undici/lib/web/fetch/response.js
generated
vendored
@@ -110,6 +110,7 @@ class Response {
|
||||
|
||||
// https://fetch.spec.whatwg.org/#dom-response
|
||||
constructor (body = null, init = {}) {
|
||||
webidl.util.markAsUncloneable(this)
|
||||
if (body === kConstruct) {
|
||||
return
|
||||
}
|
||||
|
||||
20
node_modules/undici/lib/web/fetch/util.js
generated
vendored
20
node_modules/undici/lib/web/fetch/util.js
generated
vendored
@@ -1340,6 +1340,14 @@ function buildContentRange (rangeStart, rangeEnd, fullLength) {
|
||||
// interpreted as a zlib stream, otherwise it's interpreted as a
|
||||
// raw deflate stream.
|
||||
class InflateStream extends Transform {
|
||||
#zlibOptions
|
||||
|
||||
/** @param {zlib.ZlibOptions} [zlibOptions] */
|
||||
constructor (zlibOptions) {
|
||||
super()
|
||||
this.#zlibOptions = zlibOptions
|
||||
}
|
||||
|
||||
_transform (chunk, encoding, callback) {
|
||||
if (!this._inflateStream) {
|
||||
if (chunk.length === 0) {
|
||||
@@ -1347,8 +1355,8 @@ class InflateStream extends Transform {
|
||||
return
|
||||
}
|
||||
this._inflateStream = (chunk[0] & 0x0F) === 0x08
|
||||
? zlib.createInflate()
|
||||
: zlib.createInflateRaw()
|
||||
? zlib.createInflate(this.#zlibOptions)
|
||||
: zlib.createInflateRaw(this.#zlibOptions)
|
||||
|
||||
this._inflateStream.on('data', this.push.bind(this))
|
||||
this._inflateStream.on('end', () => this.push(null))
|
||||
@@ -1367,8 +1375,12 @@ class InflateStream extends Transform {
|
||||
}
|
||||
}
|
||||
|
||||
function createInflate () {
|
||||
return new InflateStream()
|
||||
/**
|
||||
* @param {zlib.ZlibOptions} [zlibOptions]
|
||||
* @returns {InflateStream}
|
||||
*/
|
||||
function createInflate (zlibOptions) {
|
||||
return new InflateStream(zlibOptions)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
2
node_modules/undici/lib/web/fetch/webidl.js
generated
vendored
2
node_modules/undici/lib/web/fetch/webidl.js
generated
vendored
@@ -1,6 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const { types, inspect } = require('node:util')
|
||||
const { markAsUncloneable } = require('node:worker_threads')
|
||||
const { toUSVString } = require('../../core/util')
|
||||
|
||||
/** @type {import('../../../types/webidl').Webidl} */
|
||||
@@ -86,6 +87,7 @@ webidl.util.Type = function (V) {
|
||||
}
|
||||
}
|
||||
|
||||
webidl.util.markAsUncloneable = markAsUncloneable || (() => {})
|
||||
// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
||||
webidl.util.ConvertToInt = function (V, bitLength, signedness, opts) {
|
||||
let upperBound
|
||||
|
||||
Reference in New Issue
Block a user