@@ -4937,14 +4937,27 @@ module.exports = Parser;
4937
4937
4938
4938
"use strict";
4939
4939
4940
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4941
+ if (k2 === undefined) k2 = k;
4942
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4943
+ }) : (function(o, m, k, k2) {
4944
+ if (k2 === undefined) k2 = k;
4945
+ o[k2] = m[k];
4946
+ }));
4947
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4948
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
4949
+ }) : function(o, v) {
4950
+ o["default"] = v;
4951
+ });
4940
4952
var __importStar = (this && this.__importStar) || function (mod) {
4941
4953
if (mod && mod.__esModule) return mod;
4942
4954
var result = {};
4943
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k] ;
4944
- result["default"] = mod;
4955
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding( result, mod, k) ;
4956
+ __setModuleDefault( result, mod) ;
4945
4957
return result;
4946
4958
};
4947
4959
Object.defineProperty(exports, "__esModule", { value: true });
4960
+ exports.configAuthentication = void 0;
4948
4961
const fs = __importStar(__webpack_require__(747));
4949
4962
const path = __importStar(__webpack_require__(622));
4950
4963
const core = __importStar(__webpack_require__(470));
@@ -7820,22 +7833,36 @@ module.exports = require("assert");
7820
7833
7821
7834
"use strict";
7822
7835
7836
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7837
+ if (k2 === undefined) k2 = k;
7838
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7839
+ }) : (function(o, m, k, k2) {
7840
+ if (k2 === undefined) k2 = k;
7841
+ o[k2] = m[k];
7842
+ }));
7843
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7844
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7845
+ }) : function(o, v) {
7846
+ o["default"] = v;
7847
+ });
7848
+ var __importStar = (this && this.__importStar) || function (mod) {
7849
+ if (mod && mod.__esModule) return mod;
7850
+ var result = {};
7851
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7852
+ __setModuleDefault(result, mod);
7853
+ return result;
7854
+ };
7823
7855
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7856
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7824
7857
return new (P || (P = Promise))(function (resolve, reject) {
7825
7858
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7826
7859
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7827
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve( result.value); } ).then(fulfilled, rejected); }
7860
+ function step(result) { result.done ? resolve(result.value) : adopt( result.value).then(fulfilled, rejected); }
7828
7861
step((generator = generator.apply(thisArg, _arguments || [])).next());
7829
7862
});
7830
7863
};
7831
- var __importStar = (this && this.__importStar) || function (mod) {
7832
- if (mod && mod.__esModule) return mod;
7833
- var result = {};
7834
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
7835
- result["default"] = mod;
7836
- return result;
7837
- };
7838
7864
Object.defineProperty(exports, "__esModule", { value: true });
7865
+ exports.run = void 0;
7839
7866
const core = __importStar(__webpack_require__(470));
7840
7867
const installer = __importStar(__webpack_require__(749));
7841
7868
const fs = __importStar(__webpack_require__(747));
@@ -13214,6 +13241,7 @@ var HttpCodes;
13214
13241
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
13215
13242
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
13216
13243
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
13244
+ HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
13217
13245
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
13218
13246
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
13219
13247
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
@@ -13238,8 +13266,18 @@ function getProxyUrl(serverUrl) {
13238
13266
return proxyUrl ? proxyUrl.href : '';
13239
13267
}
13240
13268
exports.getProxyUrl = getProxyUrl;
13241
- const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
13242
- const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
13269
+ const HttpRedirectCodes = [
13270
+ HttpCodes.MovedPermanently,
13271
+ HttpCodes.ResourceMoved,
13272
+ HttpCodes.SeeOther,
13273
+ HttpCodes.TemporaryRedirect,
13274
+ HttpCodes.PermanentRedirect
13275
+ ];
13276
+ const HttpResponseRetryCodes = [
13277
+ HttpCodes.BadGateway,
13278
+ HttpCodes.ServiceUnavailable,
13279
+ HttpCodes.GatewayTimeout
13280
+ ];
13243
13281
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
13244
13282
const ExponentialBackoffCeiling = 10;
13245
13283
const ExponentialBackoffTimeSlice = 5;
@@ -13364,18 +13402,22 @@ class HttpClient {
13364
13402
*/
13365
13403
async request(verb, requestUrl, data, headers) {
13366
13404
if (this._disposed) {
13367
- throw new Error(" Client has already been disposed." );
13405
+ throw new Error(' Client has already been disposed.' );
13368
13406
}
13369
13407
let parsedUrl = url.parse(requestUrl);
13370
13408
let info = this._prepareRequest(verb, parsedUrl, headers);
13371
13409
// Only perform retries on reads since writes may not be idempotent.
13372
- let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
13410
+ let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
13411
+ ? this._maxRetries + 1
13412
+ : 1;
13373
13413
let numTries = 0;
13374
13414
let response;
13375
13415
while (numTries < maxTries) {
13376
13416
response = await this.requestRaw(info, data);
13377
13417
// Check if it's an authentication challenge
13378
- if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
13418
+ if (response &&
13419
+ response.message &&
13420
+ response.message.statusCode === HttpCodes.Unauthorized) {
13379
13421
let authenticationHandler;
13380
13422
for (let i = 0; i < this.handlers.length; i++) {
13381
13423
if (this.handlers[i].canHandleAuthentication(response)) {
@@ -13393,21 +13435,32 @@ class HttpClient {
13393
13435
}
13394
13436
}
13395
13437
let redirectsRemaining = this._maxRedirects;
13396
- while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
13397
- && this._allowRedirects
13398
- && redirectsRemaining > 0) {
13399
- const redirectUrl = response.message.headers[" location" ];
13438
+ while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
13439
+ this._allowRedirects &&
13440
+ redirectsRemaining > 0) {
13441
+ const redirectUrl = response.message.headers[' location' ];
13400
13442
if (!redirectUrl) {
13401
13443
// if there's no location to redirect to, we won't
13402
13444
break;
13403
13445
}
13404
13446
let parsedRedirectUrl = url.parse(redirectUrl);
13405
- if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
13406
- throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
13447
+ if (parsedUrl.protocol == 'https:' &&
13448
+ parsedUrl.protocol != parsedRedirectUrl.protocol &&
13449
+ !this._allowRedirectDowngrade) {
13450
+ throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
13407
13451
}
13408
13452
// we need to finish reading the response before reassigning response
13409
13453
// which will leak the open socket.
13410
13454
await response.readBody();
13455
+ // strip authorization header if redirected to a different hostname
13456
+ if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
13457
+ for (let header in headers) {
13458
+ // header names are case insensitive
13459
+ if (header.toLowerCase() === 'authorization') {
13460
+ delete headers[header];
13461
+ }
13462
+ }
13463
+ }
13411
13464
// let's make the request with the new redirectUrl
13412
13465
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
13413
13466
response = await this.requestRaw(info, data);
@@ -13458,8 +13511,8 @@ class HttpClient {
13458
13511
*/
13459
13512
requestRawWithCallback(info, data, onResult) {
13460
13513
let socket;
13461
- if (typeof ( data) === 'string') {
13462
- info.options.headers[" Content-Length" ] = Buffer.byteLength(data, 'utf8');
13514
+ if (typeof data === 'string') {
13515
+ info.options.headers[' Content-Length' ] = Buffer.byteLength(data, 'utf8');
13463
13516
}
13464
13517
let callbackCalled = false;
13465
13518
let handleResult = (err, res) => {
@@ -13472,7 +13525,7 @@ class HttpClient {
13472
13525
let res = new HttpClientResponse(msg);
13473
13526
handleResult(null, res);
13474
13527
});
13475
- req.on('socket', ( sock) => {
13528
+ req.on('socket', sock => {
13476
13529
socket = sock;
13477
13530
});
13478
13531
// If we ever get disconnected, we want the socket to timeout eventually
@@ -13487,10 +13540,10 @@ class HttpClient {
13487
13540
// res should have headers
13488
13541
handleResult(err, null);
13489
13542
});
13490
- if (data && typeof ( data) === 'string') {
13543
+ if (data && typeof data === 'string') {
13491
13544
req.write(data, 'utf8');
13492
13545
}
13493
- if (data && typeof ( data) !== 'string') {
13546
+ if (data && typeof data !== 'string') {
13494
13547
data.on('close', function () {
13495
13548
req.end();
13496
13549
});
@@ -13517,31 +13570,34 @@ class HttpClient {
13517
13570
const defaultPort = usingSsl ? 443 : 80;
13518
13571
info.options = {};
13519
13572
info.options.host = info.parsedUrl.hostname;
13520
- info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
13521
- info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
13573
+ info.options.port = info.parsedUrl.port
13574
+ ? parseInt(info.parsedUrl.port)
13575
+ : defaultPort;
13576
+ info.options.path =
13577
+ (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
13522
13578
info.options.method = method;
13523
13579
info.options.headers = this._mergeHeaders(headers);
13524
13580
if (this.userAgent != null) {
13525
- info.options.headers[" user-agent" ] = this.userAgent;
13581
+ info.options.headers[' user-agent' ] = this.userAgent;
13526
13582
}
13527
13583
info.options.agent = this._getAgent(info.parsedUrl);
13528
13584
// gives handlers an opportunity to participate
13529
13585
if (this.handlers) {
13530
- this.handlers.forEach(( handler) => {
13586
+ this.handlers.forEach(handler => {
13531
13587
handler.prepareRequest(info.options);
13532
13588
});
13533
13589
}
13534
13590
return info;
13535
13591
}
13536
13592
_mergeHeaders(headers) {
13537
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
13593
+ const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (( c[k.toLowerCase()] = obj[k]) , c), {});
13538
13594
if (this.requestOptions && this.requestOptions.headers) {
13539
13595
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
13540
13596
}
13541
13597
return lowercaseKeys(headers || {});
13542
13598
}
13543
13599
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
13544
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
13600
+ const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (( c[k.toLowerCase()] = obj[k]) , c), {});
13545
13601
let clientHeader;
13546
13602
if (this.requestOptions && this.requestOptions.headers) {
13547
13603
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
@@ -13579,7 +13635,7 @@ class HttpClient {
13579
13635
proxyAuth: proxyUrl.auth,
13580
13636
host: proxyUrl.hostname,
13581
13637
port: proxyUrl.port
13582
- },
13638
+ }
13583
13639
};
13584
13640
let tunnelAgent;
13585
13641
const overHttps = proxyUrl.protocol === 'https:';
@@ -13606,7 +13662,9 @@ class HttpClient {
13606
13662
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
13607
13663
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
13608
13664
// we have to cast it to any and change it directly
13609
- agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
13665
+ agent.options = Object.assign(agent.options || {}, {
13666
+ rejectUnauthorized: false
13667
+ });
13610
13668
}
13611
13669
return agent;
13612
13670
}
@@ -13667,7 +13725,7 @@ class HttpClient {
13667
13725
msg = contents;
13668
13726
}
13669
13727
else {
13670
- msg = " Failed request: (" + statusCode + ")" ;
13728
+ msg = ' Failed request: (' + statusCode + ')' ;
13671
13729
}
13672
13730
let err = new Error(msg);
13673
13731
// attach statusCode and body obj (if available) to the error object
@@ -17305,22 +17363,36 @@ module.exports = require("fs");
17305
17363
17306
17364
"use strict";
17307
17365
17366
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17367
+ if (k2 === undefined) k2 = k;
17368
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17369
+ }) : (function(o, m, k, k2) {
17370
+ if (k2 === undefined) k2 = k;
17371
+ o[k2] = m[k];
17372
+ }));
17373
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17374
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17375
+ }) : function(o, v) {
17376
+ o["default"] = v;
17377
+ });
17378
+ var __importStar = (this && this.__importStar) || function (mod) {
17379
+ if (mod && mod.__esModule) return mod;
17380
+ var result = {};
17381
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17382
+ __setModuleDefault(result, mod);
17383
+ return result;
17384
+ };
17308
17385
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17386
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17309
17387
return new (P || (P = Promise))(function (resolve, reject) {
17310
17388
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17311
17389
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17312
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve( result.value); } ).then(fulfilled, rejected); }
17390
+ function step(result) { result.done ? resolve(result.value) : adopt( result.value).then(fulfilled, rejected); }
17313
17391
step((generator = generator.apply(thisArg, _arguments || [])).next());
17314
17392
});
17315
17393
};
17316
- var __importStar = (this && this.__importStar) || function (mod) {
17317
- if (mod && mod.__esModule) return mod;
17318
- var result = {};
17319
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
17320
- result["default"] = mod;
17321
- return result;
17322
- };
17323
17394
Object.defineProperty(exports, "__esModule", { value: true });
17395
+ exports.DotnetCoreInstaller = void 0;
17324
17396
// Load tempDirectory before it gets wiped by tool-cache
17325
17397
let tempDirectory = process.env['RUNNER_TEMPDIRECTORY'] || '';
17326
17398
const core = __importStar(__webpack_require__(470));
@@ -21153,12 +21225,10 @@ function getProxyUrl(reqUrl) {
21153
21225
}
21154
21226
let proxyVar;
21155
21227
if (usingSsl) {
21156
- proxyVar = process.env["https_proxy"] ||
21157
- process.env["HTTPS_PROXY"];
21228
+ proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
21158
21229
}
21159
21230
else {
21160
- proxyVar = process.env["http_proxy"] ||
21161
- process.env["HTTP_PROXY"];
21231
+ proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
21162
21232
}
21163
21233
if (proxyVar) {
21164
21234
proxyUrl = url.parse(proxyVar);
@@ -21170,7 +21240,7 @@ function checkBypass(reqUrl) {
21170
21240
if (!reqUrl.hostname) {
21171
21241
return false;
21172
21242
}
21173
- let noProxy = process.env[" no_proxy" ] || process.env[" NO_PROXY" ] || '';
21243
+ let noProxy = process.env[' no_proxy' ] || process.env[' NO_PROXY' ] || '';
21174
21244
if (!noProxy) {
21175
21245
return false;
21176
21246
}
@@ -21191,7 +21261,10 @@ function checkBypass(reqUrl) {
21191
21261
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
21192
21262
}
21193
21263
// Compare request host against noproxy
21194
- for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
21264
+ for (let upperNoProxyItem of noProxy
21265
+ .split(',')
21266
+ .map(x => x.trim().toUpperCase())
21267
+ .filter(x => x)) {
21195
21268
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
21196
21269
return true;
21197
21270
}
0 commit comments