@@ -20338,6 +20338,26 @@ function delay(timeInMs, options) {
20338
20338
});
20339
20339
}
20340
20340
20341
+ // Copyright (c) Microsoft Corporation.
20342
+ /**
20343
+ * promise.race() wrapper that aborts rest of promises as soon as the first promise settles.
20344
+ */
20345
+ async function cancelablePromiseRace(abortablePromiseBuilders, options) {
20346
+ var _a, _b;
20347
+ const aborter = new abortController.AbortController();
20348
+ function abortHandler() {
20349
+ aborter.abort();
20350
+ }
20351
+ (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler);
20352
+ try {
20353
+ return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal })));
20354
+ }
20355
+ finally {
20356
+ aborter.abort();
20357
+ (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler);
20358
+ }
20359
+ }
20360
+
20341
20361
// Copyright (c) Microsoft Corporation.
20342
20362
// Licensed under the MIT license.
20343
20363
/**
@@ -20635,6 +20655,7 @@ function base64UrlToUint8Array(value) {
20635
20655
return Buffer.from(value, "base64url");
20636
20656
}
20637
20657
20658
+ exports.cancelablePromiseRace = cancelablePromiseRace;
20638
20659
exports.computeSha256Hash = computeSha256Hash;
20639
20660
exports.computeSha256Hmac = computeSha256Hmac;
20640
20661
exports.createAbortablePromise = createAbortablePromise;
@@ -48632,7 +48653,7 @@ __export(dist_src_exports, {
48632
48653
module.exports = __toCommonJS(dist_src_exports);
48633
48654
48634
48655
// pkg/dist-src/version.js
48635
- var VERSION = "10.0.0 ";
48656
+ var VERSION = "10.0.1 ";
48636
48657
48637
48658
// pkg/dist-src/generated/endpoints.js
48638
48659
var Endpoints = {
@@ -50515,11 +50536,41 @@ for (const [scope, endpoints] of Object.entries(endpoints_default)) {
50515
50536
}
50516
50537
}
50517
50538
var handler = {
50539
+ has({ scope }, methodName) {
50540
+ return endpointMethodsMap.get(scope).has(methodName);
50541
+ },
50542
+ getOwnPropertyDescriptor(target, methodName) {
50543
+ return {
50544
+ value: this.get(target, methodName),
50545
+ // ensures method is in the cache
50546
+ configurable: true,
50547
+ writable: true,
50548
+ enumerable: true
50549
+ };
50550
+ },
50551
+ defineProperty(target, methodName, descriptor) {
50552
+ Object.defineProperty(target.cache, methodName, descriptor);
50553
+ return true;
50554
+ },
50555
+ deleteProperty(target, methodName) {
50556
+ delete target.cache[methodName];
50557
+ return true;
50558
+ },
50559
+ ownKeys({ scope }) {
50560
+ return [...endpointMethodsMap.get(scope).keys()];
50561
+ },
50562
+ set(target, methodName, value) {
50563
+ return target.cache[methodName] = value;
50564
+ },
50518
50565
get({ octokit, scope, cache }, methodName) {
50519
50566
if (cache[methodName]) {
50520
50567
return cache[methodName];
50521
50568
}
50522
- const { decorations, endpointDefaults } = endpointMethodsMap.get(scope).get(methodName);
50569
+ const method = endpointMethodsMap.get(scope).get(methodName);
50570
+ if (!method) {
50571
+ return void 0;
50572
+ }
50573
+ const { endpointDefaults, decorations } = method;
50523
50574
if (decorations) {
50524
50575
cache[methodName] = decorate(
50525
50576
octokit,
@@ -58128,6 +58179,7 @@ function onceStrict (fn) {
58128
58179
} catch (ex) {
58129
58180
Stream = function () {}
58130
58181
}
58182
+ if (!Stream) Stream = function () {}
58131
58183
58132
58184
var streamWraps = sax.EVENTS.filter(function (ev) {
58133
58185
return ev !== 'error' && ev !== 'end'
@@ -59446,9 +59498,16 @@ function onceStrict (fn) {
59446
59498
}
59447
59499
59448
59500
if (c === ';') {
59449
- parser[buffer] += parseEntity(parser)
59450
- parser.entity = ''
59451
- parser.state = returnState
59501
+ if (parser.opt.unparsedEntities) {
59502
+ var parsedEntity = parseEntity(parser)
59503
+ parser.entity = ''
59504
+ parser.state = returnState
59505
+ parser.write(parsedEntity)
59506
+ } else {
59507
+ parser[buffer] += parseEntity(parser)
59508
+ parser.entity = ''
59509
+ parser.state = returnState
59510
+ }
59452
59511
} else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
59453
59512
parser.entity += c
59454
59513
} else {
@@ -59460,8 +59519,9 @@ function onceStrict (fn) {
59460
59519
59461
59520
continue
59462
59521
59463
- default:
59522
+ default: /* istanbul ignore next */ {
59464
59523
throw new Error(parser, 'Unknown state: ' + parser.state)
59524
+ }
59465
59525
}
59466
59526
} // while
59467
59527
@@ -66646,6 +66706,7 @@ module.exports = {
66646
66706
66647
66707
const assert = __nccwpck_require__(9491)
66648
66708
const net = __nccwpck_require__(1808)
66709
+ const http = __nccwpck_require__(3685)
66649
66710
const { pipeline } = __nccwpck_require__(2781)
66650
66711
const util = __nccwpck_require__(3983)
66651
66712
const timers = __nccwpck_require__(9459)
@@ -66733,6 +66794,7 @@ const {
66733
66794
HTTP2_HEADER_AUTHORITY,
66734
66795
HTTP2_HEADER_METHOD,
66735
66796
HTTP2_HEADER_PATH,
66797
+ HTTP2_HEADER_SCHEME,
66736
66798
HTTP2_HEADER_CONTENT_LENGTH,
66737
66799
HTTP2_HEADER_EXPECT,
66738
66800
HTTP2_HEADER_STATUS
@@ -66909,7 +66971,7 @@ class Client extends DispatcherBase {
66909
66971
this[kConnector] = connect
66910
66972
this[kSocket] = null
66911
66973
this[kPipelining] = pipelining != null ? pipelining : 1
66912
- this[kMaxHeadersSize] = maxHeaderSize || 16384
66974
+ this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
66913
66975
this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
66914
66976
this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
66915
66977
this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
@@ -68329,7 +68391,7 @@ function writeH2 (client, session, request) {
68329
68391
const h2State = client[kHTTP2SessionState]
68330
68392
68331
68393
headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
68332
- headers[HTTP2_HEADER_PATH ] = path
68394
+ headers[HTTP2_HEADER_METHOD ] = method
68333
68395
68334
68396
if (method === 'CONNECT') {
68335
68397
session.ref()
@@ -68356,10 +68418,14 @@ function writeH2 (client, session, request) {
68356
68418
})
68357
68419
68358
68420
return true
68359
- } else {
68360
- headers[HTTP2_HEADER_METHOD] = method
68361
68421
}
68362
68422
68423
+ // https://tools.ietf.org/html/rfc7540#section-8.3
68424
+ // :path and :scheme headers must be omited when sending CONNECT
68425
+
68426
+ headers[HTTP2_HEADER_PATH] = path
68427
+ headers[HTTP2_HEADER_SCHEME] = 'https'
68428
+
68363
68429
// https://tools.ietf.org/html/rfc7231#section-4.3.1
68364
68430
// https://tools.ietf.org/html/rfc7231#section-4.3.2
68365
68431
// https://tools.ietf.org/html/rfc7231#section-4.3.5
@@ -68496,6 +68562,7 @@ function writeH2 (client, session, request) {
68496
68562
stream.cork()
68497
68563
stream.write(body)
68498
68564
stream.uncork()
68565
+ stream.end()
68499
68566
request.onBodySent(body)
68500
68567
request.onRequestSent()
68501
68568
} else if (util.isBlobLike(body)) {
@@ -68730,13 +68797,17 @@ async function writeIterable ({ h2stream, body, client, request, socket, content
68730
68797
throw socket[kError]
68731
68798
}
68732
68799
68733
- if (!h2stream.write(chunk)) {
68800
+ const res = h2stream.write(chunk)
68801
+ request.onBodySent(chunk)
68802
+ if (!res) {
68734
68803
await waitForDrain()
68735
68804
}
68736
68805
}
68737
68806
} catch (err) {
68738
68807
h2stream.destroy(err)
68739
68808
} finally {
68809
+ request.onRequestSent()
68810
+ h2stream.end()
68740
68811
h2stream
68741
68812
.off('close', onDrain)
68742
68813
.off('drain', onDrain)
@@ -68949,11 +69020,13 @@ class CompatFinalizer {
68949
69020
}
68950
69021
68951
69022
register (dispatcher, key) {
68952
- dispatcher.on('disconnect', () => {
68953
- if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
68954
- this.finalizer(key)
68955
- }
68956
- })
69023
+ if (dispatcher.on) {
69024
+ dispatcher.on('disconnect', () => {
69025
+ if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
69026
+ this.finalizer(key)
69027
+ }
69028
+ })
69029
+ }
68957
69030
}
68958
69031
}
68959
69032
@@ -70619,7 +70692,8 @@ function processHeader (request, key, val, skipAppend = false) {
70619
70692
key.toLowerCase() === 'content-type'
70620
70693
) {
70621
70694
request.contentType = val
70622
- request.headers += processHeaderValue(key, val)
70695
+ if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
70696
+ else request.headers += processHeaderValue(key, val)
70623
70697
} else if (
70624
70698
key.length === 17 &&
70625
70699
key.toLowerCase() === 'transfer-encoding'
@@ -75309,6 +75383,10 @@ async function httpRedirectFetch (fetchParams, response) {
75309
75383
if (!sameOrigin(requestCurrentURL(request), locationURL)) {
75310
75384
// https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
75311
75385
request.headersList.delete('authorization')
75386
+
75387
+ // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
75388
+ request.headersList.delete('cookie')
75389
+ request.headersList.delete('host')
75312
75390
}
75313
75391
75314
75392
// 14. If request’s body is non-null, then set request’s body to the first return
@@ -75453,7 +75531,7 @@ async function httpNetworkOrCacheFetch (
75453
75531
// user agents should append `User-Agent`/default `User-Agent` value to
75454
75532
// httpRequest’s header list.
75455
75533
if (!httpRequest.headersList.contains('user-agent')) {
75456
- httpRequest.headersList.append('user-agent', ' undici')
75534
+ httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? ' undici' : 'node ')
75457
75535
}
75458
75536
75459
75537
// 15. If httpRequest’s cache mode is "default" and httpRequest’s header
@@ -75515,6 +75593,8 @@ async function httpNetworkOrCacheFetch (
75515
75593
}
75516
75594
}
75517
75595
75596
+ httpRequest.headersList.delete('host')
75597
+
75518
75598
// 20. If includeCredentials is true, then:
75519
75599
if (includeCredentials) {
75520
75600
// 1. If the user agent is not configured to block cookies for httpRequest
0 commit comments