diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index 50a3aac77..6742eb52e 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -15,13 +15,6 @@
"tmp-promise": "^2.0.2"
}
},
- "node_modules/@actions/artifact/node_modules/@actions/http-client": {
- "version": "1.0.11",
- "license": "MIT",
- "dependencies": {
- "tunnel": "0.0.6"
- }
- },
"node_modules/@actions/core": {
"version": "1.2.6",
"license": "MIT"
@@ -41,8 +34,9 @@
}
},
"node_modules/@actions/http-client": {
- "version": "1.0.8",
- "license": "MIT",
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
+ "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
"dependencies": {
"tunnel": "0.0.6"
}
@@ -5001,13 +4995,6 @@
"dev": true,
"license": "Apache-2.0"
},
- "node_modules/tunnel": {
- "version": "0.0.6",
- "license": "MIT",
- "engines": {
- "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
- }
- },
"node_modules/type-check": {
"version": "0.4.0",
"dev": true,
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/LICENSE b/node_modules/@actions/artifact/node_modules/@actions/http-client/LICENSE
deleted file mode 100644
index 5823a51c3..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-Actions Http Client for Node.js
-
-Copyright (c) GitHub, Inc.
-
-All rights reserved.
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
-associated documentation files (the "Software"), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
-LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/README.md b/node_modules/@actions/artifact/node_modules/@actions/http-client/README.md
deleted file mode 100644
index be61eb351..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-# Actions Http-Client
-
-[![Http Status](https://github.com/actions/http-client/workflows/http-tests/badge.svg)](https://github.com/actions/http-client/actions)
-
-A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
-
-## Features
-
- - HTTP client with TypeScript generics and async/await/Promises
- - Typings included so no need to acquire separately (great for intellisense and no versioning drift)
- - [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
- - Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
- - Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
- - Redirects supported
-
-Features and releases [here](./RELEASES.md)
-
-## Install
-
-```
-npm install @actions/http-client --save
-```
-
-## Samples
-
-See the [HTTP](./__tests__) tests for detailed examples.
-
-## Errors
-
-### HTTP
-
-The HTTP client does not throw unless truly exceptional.
-
-* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
-* Redirects (3xx) will be followed by default.
-
-See [HTTP tests](./__tests__) for detailed examples.
-
-## Debugging
-
-To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
-
-```
-export NODE_DEBUG=http
-```
-
-## Node support
-
-The http-client is built using the latest LTS version of Node 12. It may work on previous node LTS versions but it's tested and officially supported on Node12+.
-
-## Support and Versioning
-
-We follow semver and will hold compatibility between major versions and increment the minor version with new features and capabilities (while holding compat).
-
-## Contributing
-
-We welcome PRs. Please create an issue and if applicable, a design before proceeding with code.
-
-once:
-
-```bash
-$ npm install
-```
-
-To build:
-
-```bash
-$ npm run build
-```
-
-To run all tests:
-```bash
-$ npm test
-```
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/RELEASES.md b/node_modules/@actions/artifact/node_modules/@actions/http-client/RELEASES.md
deleted file mode 100644
index 935178a83..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/RELEASES.md
+++ /dev/null
@@ -1,26 +0,0 @@
-## Releases
-
-## 1.0.10
-
-Contains a bug fix where proxy is defined without a user and password. see [PR here](https://github.com/actions/http-client/pull/42)
-
-## 1.0.9
-Throw HttpClientError instead of a generic Error from the \Json() helper methods when the server responds with a non-successful status code.
-
-## 1.0.8
-Fixed security issue where a redirect (e.g. 302) to another domain would pass headers. The fix was to strip the authorization header if the hostname was different. More [details in PR #27](https://github.com/actions/http-client/pull/27)
-
-## 1.0.7
-Update NPM dependencies and add 429 to the list of HttpCodes
-
-## 1.0.6
-Automatically sends Content-Type and Accept application/json headers for \Json() helper methods if not set in the client or parameters.
-
-## 1.0.5
-Adds \Json() helper methods for json over http scenarios.
-
-## 1.0.4
-Started to add \Json() helper methods. Do not use this release for that. Use >= 1.0.5 since there was an issue with types.
-
-## 1.0.1 to 1.0.3
-Adds proxy support.
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/actions.png b/node_modules/@actions/artifact/node_modules/@actions/http-client/actions.png
deleted file mode 100644
index 1857ef375..000000000
Binary files a/node_modules/@actions/artifact/node_modules/@actions/http-client/actions.png and /dev/null differ
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/auth.d.ts b/node_modules/@actions/artifact/node_modules/@actions/http-client/auth.d.ts
deleted file mode 100644
index 1094189cf..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/auth.d.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import ifm = require('./interfaces');
-export declare class BasicCredentialHandler implements ifm.IRequestHandler {
- username: string;
- password: string;
- constructor(username: string, password: string);
- prepareRequest(options: any): void;
- canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
- handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise;
-}
-export declare class BearerCredentialHandler implements ifm.IRequestHandler {
- token: string;
- constructor(token: string);
- prepareRequest(options: any): void;
- canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
- handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise;
-}
-export declare class PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler {
- token: string;
- constructor(token: string);
- prepareRequest(options: any): void;
- canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
- handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise;
-}
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/auth.js b/node_modules/@actions/artifact/node_modules/@actions/http-client/auth.js
deleted file mode 100644
index 67a58aa78..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/auth.js
+++ /dev/null
@@ -1,58 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-class BasicCredentialHandler {
- constructor(username, password) {
- this.username = username;
- this.password = password;
- }
- prepareRequest(options) {
- options.headers['Authorization'] =
- 'Basic ' +
- Buffer.from(this.username + ':' + this.password).toString('base64');
- }
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
- }
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
- }
-}
-exports.BasicCredentialHandler = BasicCredentialHandler;
-class BearerCredentialHandler {
- constructor(token) {
- this.token = token;
- }
- // currently implements pre-authorization
- // TODO: support preAuth = false where it hooks on 401
- prepareRequest(options) {
- options.headers['Authorization'] = 'Bearer ' + this.token;
- }
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
- }
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
- }
-}
-exports.BearerCredentialHandler = BearerCredentialHandler;
-class PersonalAccessTokenCredentialHandler {
- constructor(token) {
- this.token = token;
- }
- // currently implements pre-authorization
- // TODO: support preAuth = false where it hooks on 401
- prepareRequest(options) {
- options.headers['Authorization'] =
- 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
- }
- // This handler cannot handle 401
- canHandleAuthentication(response) {
- return false;
- }
- handleAuthentication(httpClient, requestInfo, objs) {
- return null;
- }
-}
-exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/index.d.ts b/node_modules/@actions/artifact/node_modules/@actions/http-client/index.d.ts
deleted file mode 100644
index 9583dc72a..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/index.d.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-///
-import http = require('http');
-import ifm = require('./interfaces');
-export declare enum HttpCodes {
- OK = 200,
- MultipleChoices = 300,
- MovedPermanently = 301,
- ResourceMoved = 302,
- SeeOther = 303,
- NotModified = 304,
- UseProxy = 305,
- SwitchProxy = 306,
- TemporaryRedirect = 307,
- PermanentRedirect = 308,
- BadRequest = 400,
- Unauthorized = 401,
- PaymentRequired = 402,
- Forbidden = 403,
- NotFound = 404,
- MethodNotAllowed = 405,
- NotAcceptable = 406,
- ProxyAuthenticationRequired = 407,
- RequestTimeout = 408,
- Conflict = 409,
- Gone = 410,
- TooManyRequests = 429,
- InternalServerError = 500,
- NotImplemented = 501,
- BadGateway = 502,
- ServiceUnavailable = 503,
- GatewayTimeout = 504
-}
-export declare enum Headers {
- Accept = "accept",
- ContentType = "content-type"
-}
-export declare enum MediaTypes {
- ApplicationJson = "application/json"
-}
-/**
- * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
-export declare function getProxyUrl(serverUrl: string): string;
-export declare class HttpClientError extends Error {
- constructor(message: string, statusCode: number);
- statusCode: number;
- result?: any;
-}
-export declare class HttpClientResponse implements ifm.IHttpClientResponse {
- constructor(message: http.IncomingMessage);
- message: http.IncomingMessage;
- readBody(): Promise;
-}
-export declare function isHttps(requestUrl: string): boolean;
-export declare class HttpClient {
- userAgent: string | undefined;
- handlers: ifm.IRequestHandler[];
- requestOptions: ifm.IRequestOptions;
- private _ignoreSslError;
- private _socketTimeout;
- private _allowRedirects;
- private _allowRedirectDowngrade;
- private _maxRedirects;
- private _allowRetries;
- private _maxRetries;
- private _agent;
- private _proxyAgent;
- private _keepAlive;
- private _disposed;
- constructor(userAgent?: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions);
- options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise;
- get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise;
- del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise;
- post(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise;
- patch(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise;
- put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise;
- head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise;
- sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise;
- /**
- * Gets a typed object from an endpoint
- * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
- */
- getJson(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise>;
- postJson(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise>;
- putJson(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise>;
- patchJson(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise>;
- /**
- * Makes a raw http request.
- * All other methods such as get, post, patch, and request ultimately call this.
- * Prefer get, del, post and patch
- */
- request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: ifm.IHeaders): Promise;
- /**
- * Needs to be called if keepAlive is set to true in request options.
- */
- dispose(): void;
- /**
- * Raw request.
- * @param info
- * @param data
- */
- requestRaw(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream): Promise;
- /**
- * Raw request with callback.
- * @param info
- * @param data
- * @param onResult
- */
- requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void;
- /**
- * Gets an http agent. This function is useful when you need an http agent that handles
- * routing through a proxy server - depending upon the url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
- getAgent(serverUrl: string): http.Agent;
- private _prepareRequest;
- private _mergeHeaders;
- private _getExistingOrDefaultHeader;
- private _getAgent;
- private _performExponentialBackoff;
- private static dateTimeDeserializer;
- private _processResponse;
-}
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/index.js b/node_modules/@actions/artifact/node_modules/@actions/http-client/index.js
deleted file mode 100644
index 43b2b1039..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/index.js
+++ /dev/null
@@ -1,537 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const http = require("http");
-const https = require("https");
-const pm = require("./proxy");
-let tunnel;
-var HttpCodes;
-(function (HttpCodes) {
- HttpCodes[HttpCodes["OK"] = 200] = "OK";
- HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
- HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
- HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
- HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
- HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
- HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
- HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
- HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
- HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
- HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
- HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
- HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
- HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
- HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
- HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
- HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
- HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
- HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
- HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
- HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
- HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
- HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
- HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
- HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
- HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
- HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
-})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
-var Headers;
-(function (Headers) {
- Headers["Accept"] = "accept";
- Headers["ContentType"] = "content-type";
-})(Headers = exports.Headers || (exports.Headers = {}));
-var MediaTypes;
-(function (MediaTypes) {
- MediaTypes["ApplicationJson"] = "application/json";
-})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
-/**
- * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
-function getProxyUrl(serverUrl) {
- let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
- return proxyUrl ? proxyUrl.href : '';
-}
-exports.getProxyUrl = getProxyUrl;
-const HttpRedirectCodes = [
- HttpCodes.MovedPermanently,
- HttpCodes.ResourceMoved,
- HttpCodes.SeeOther,
- HttpCodes.TemporaryRedirect,
- HttpCodes.PermanentRedirect
-];
-const HttpResponseRetryCodes = [
- HttpCodes.BadGateway,
- HttpCodes.ServiceUnavailable,
- HttpCodes.GatewayTimeout
-];
-const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
-const ExponentialBackoffCeiling = 10;
-const ExponentialBackoffTimeSlice = 5;
-class HttpClientError extends Error {
- constructor(message, statusCode) {
- super(message);
- this.name = 'HttpClientError';
- this.statusCode = statusCode;
- Object.setPrototypeOf(this, HttpClientError.prototype);
- }
-}
-exports.HttpClientError = HttpClientError;
-class HttpClientResponse {
- constructor(message) {
- this.message = message;
- }
- readBody() {
- return new Promise(async (resolve, reject) => {
- let output = Buffer.alloc(0);
- this.message.on('data', (chunk) => {
- output = Buffer.concat([output, chunk]);
- });
- this.message.on('end', () => {
- resolve(output.toString());
- });
- });
- }
-}
-exports.HttpClientResponse = HttpClientResponse;
-function isHttps(requestUrl) {
- let parsedUrl = new URL(requestUrl);
- return parsedUrl.protocol === 'https:';
-}
-exports.isHttps = isHttps;
-class HttpClient {
- constructor(userAgent, handlers, requestOptions) {
- this._ignoreSslError = false;
- this._allowRedirects = true;
- this._allowRedirectDowngrade = false;
- this._maxRedirects = 50;
- this._allowRetries = false;
- this._maxRetries = 1;
- this._keepAlive = false;
- this._disposed = false;
- this.userAgent = userAgent;
- this.handlers = handlers || [];
- this.requestOptions = requestOptions;
- if (requestOptions) {
- if (requestOptions.ignoreSslError != null) {
- this._ignoreSslError = requestOptions.ignoreSslError;
- }
- this._socketTimeout = requestOptions.socketTimeout;
- if (requestOptions.allowRedirects != null) {
- this._allowRedirects = requestOptions.allowRedirects;
- }
- if (requestOptions.allowRedirectDowngrade != null) {
- this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
- }
- if (requestOptions.maxRedirects != null) {
- this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
- }
- if (requestOptions.keepAlive != null) {
- this._keepAlive = requestOptions.keepAlive;
- }
- if (requestOptions.allowRetries != null) {
- this._allowRetries = requestOptions.allowRetries;
- }
- if (requestOptions.maxRetries != null) {
- this._maxRetries = requestOptions.maxRetries;
- }
- }
- }
- options(requestUrl, additionalHeaders) {
- return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
- }
- get(requestUrl, additionalHeaders) {
- return this.request('GET', requestUrl, null, additionalHeaders || {});
- }
- del(requestUrl, additionalHeaders) {
- return this.request('DELETE', requestUrl, null, additionalHeaders || {});
- }
- post(requestUrl, data, additionalHeaders) {
- return this.request('POST', requestUrl, data, additionalHeaders || {});
- }
- patch(requestUrl, data, additionalHeaders) {
- return this.request('PATCH', requestUrl, data, additionalHeaders || {});
- }
- put(requestUrl, data, additionalHeaders) {
- return this.request('PUT', requestUrl, data, additionalHeaders || {});
- }
- head(requestUrl, additionalHeaders) {
- return this.request('HEAD', requestUrl, null, additionalHeaders || {});
- }
- sendStream(verb, requestUrl, stream, additionalHeaders) {
- return this.request(verb, requestUrl, stream, additionalHeaders);
- }
- /**
- * Gets a typed object from an endpoint
- * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
- */
- async getJson(requestUrl, additionalHeaders = {}) {
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- let res = await this.get(requestUrl, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async postJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.post(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async putJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.put(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- async patchJson(requestUrl, obj, additionalHeaders = {}) {
- let data = JSON.stringify(obj, null, 2);
- additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
- additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
- let res = await this.patch(requestUrl, data, additionalHeaders);
- return this._processResponse(res, this.requestOptions);
- }
- /**
- * Makes a raw http request.
- * All other methods such as get, post, patch, and request ultimately call this.
- * Prefer get, del, post and patch
- */
- async request(verb, requestUrl, data, headers) {
- if (this._disposed) {
- throw new Error('Client has already been disposed.');
- }
- let parsedUrl = new URL(requestUrl);
- let info = this._prepareRequest(verb, parsedUrl, headers);
- // Only perform retries on reads since writes may not be idempotent.
- let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
- ? this._maxRetries + 1
- : 1;
- let numTries = 0;
- let response;
- while (numTries < maxTries) {
- response = await this.requestRaw(info, data);
- // Check if it's an authentication challenge
- if (response &&
- response.message &&
- response.message.statusCode === HttpCodes.Unauthorized) {
- let authenticationHandler;
- for (let i = 0; i < this.handlers.length; i++) {
- if (this.handlers[i].canHandleAuthentication(response)) {
- authenticationHandler = this.handlers[i];
- break;
- }
- }
- if (authenticationHandler) {
- return authenticationHandler.handleAuthentication(this, info, data);
- }
- else {
- // We have received an unauthorized response but have no handlers to handle it.
- // Let the response return to the caller.
- return response;
- }
- }
- let redirectsRemaining = this._maxRedirects;
- while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
- this._allowRedirects &&
- redirectsRemaining > 0) {
- const redirectUrl = response.message.headers['location'];
- if (!redirectUrl) {
- // if there's no location to redirect to, we won't
- break;
- }
- let parsedRedirectUrl = new URL(redirectUrl);
- if (parsedUrl.protocol == 'https:' &&
- parsedUrl.protocol != parsedRedirectUrl.protocol &&
- !this._allowRedirectDowngrade) {
- 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.');
- }
- // we need to finish reading the response before reassigning response
- // which will leak the open socket.
- await response.readBody();
- // strip authorization header if redirected to a different hostname
- if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
- for (let header in headers) {
- // header names are case insensitive
- if (header.toLowerCase() === 'authorization') {
- delete headers[header];
- }
- }
- }
- // let's make the request with the new redirectUrl
- info = this._prepareRequest(verb, parsedRedirectUrl, headers);
- response = await this.requestRaw(info, data);
- redirectsRemaining--;
- }
- if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
- // If not a retry code, return immediately instead of retrying
- return response;
- }
- numTries += 1;
- if (numTries < maxTries) {
- await response.readBody();
- await this._performExponentialBackoff(numTries);
- }
- }
- return response;
- }
- /**
- * Needs to be called if keepAlive is set to true in request options.
- */
- dispose() {
- if (this._agent) {
- this._agent.destroy();
- }
- this._disposed = true;
- }
- /**
- * Raw request.
- * @param info
- * @param data
- */
- requestRaw(info, data) {
- return new Promise((resolve, reject) => {
- let callbackForResult = function (err, res) {
- if (err) {
- reject(err);
- }
- resolve(res);
- };
- this.requestRawWithCallback(info, data, callbackForResult);
- });
- }
- /**
- * Raw request with callback.
- * @param info
- * @param data
- * @param onResult
- */
- requestRawWithCallback(info, data, onResult) {
- let socket;
- if (typeof data === 'string') {
- info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
- }
- let callbackCalled = false;
- let handleResult = (err, res) => {
- if (!callbackCalled) {
- callbackCalled = true;
- onResult(err, res);
- }
- };
- let req = info.httpModule.request(info.options, (msg) => {
- let res = new HttpClientResponse(msg);
- handleResult(null, res);
- });
- req.on('socket', sock => {
- socket = sock;
- });
- // If we ever get disconnected, we want the socket to timeout eventually
- req.setTimeout(this._socketTimeout || 3 * 60000, () => {
- if (socket) {
- socket.end();
- }
- handleResult(new Error('Request timeout: ' + info.options.path), null);
- });
- req.on('error', function (err) {
- // err has statusCode property
- // res should have headers
- handleResult(err, null);
- });
- if (data && typeof data === 'string') {
- req.write(data, 'utf8');
- }
- if (data && typeof data !== 'string') {
- data.on('close', function () {
- req.end();
- });
- data.pipe(req);
- }
- else {
- req.end();
- }
- }
- /**
- * Gets an http agent. This function is useful when you need an http agent that handles
- * routing through a proxy server - depending upon the url and proxy environment variables.
- * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
- */
- getAgent(serverUrl) {
- let parsedUrl = new URL(serverUrl);
- return this._getAgent(parsedUrl);
- }
- _prepareRequest(method, requestUrl, headers) {
- const info = {};
- info.parsedUrl = requestUrl;
- const usingSsl = info.parsedUrl.protocol === 'https:';
- info.httpModule = usingSsl ? https : http;
- const defaultPort = usingSsl ? 443 : 80;
- info.options = {};
- info.options.host = info.parsedUrl.hostname;
- info.options.port = info.parsedUrl.port
- ? parseInt(info.parsedUrl.port)
- : defaultPort;
- info.options.path =
- (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
- info.options.method = method;
- info.options.headers = this._mergeHeaders(headers);
- if (this.userAgent != null) {
- info.options.headers['user-agent'] = this.userAgent;
- }
- info.options.agent = this._getAgent(info.parsedUrl);
- // gives handlers an opportunity to participate
- if (this.handlers) {
- this.handlers.forEach(handler => {
- handler.prepareRequest(info.options);
- });
- }
- return info;
- }
- _mergeHeaders(headers) {
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
- if (this.requestOptions && this.requestOptions.headers) {
- return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
- }
- return lowercaseKeys(headers || {});
- }
- _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
- const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
- let clientHeader;
- if (this.requestOptions && this.requestOptions.headers) {
- clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
- }
- return additionalHeaders[header] || clientHeader || _default;
- }
- _getAgent(parsedUrl) {
- let agent;
- let proxyUrl = pm.getProxyUrl(parsedUrl);
- let useProxy = proxyUrl && proxyUrl.hostname;
- if (this._keepAlive && useProxy) {
- agent = this._proxyAgent;
- }
- if (this._keepAlive && !useProxy) {
- agent = this._agent;
- }
- // if agent is already assigned use that agent.
- if (!!agent) {
- return agent;
- }
- const usingSsl = parsedUrl.protocol === 'https:';
- let maxSockets = 100;
- if (!!this.requestOptions) {
- maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
- }
- if (useProxy) {
- // If using proxy, need tunnel
- if (!tunnel) {
- tunnel = require('tunnel');
- }
- const agentOptions = {
- maxSockets: maxSockets,
- keepAlive: this._keepAlive,
- proxy: {
- ...((proxyUrl.username || proxyUrl.password) && {
- proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
- }),
- host: proxyUrl.hostname,
- port: proxyUrl.port
- }
- };
- let tunnelAgent;
- const overHttps = proxyUrl.protocol === 'https:';
- if (usingSsl) {
- tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
- }
- else {
- tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
- }
- agent = tunnelAgent(agentOptions);
- this._proxyAgent = agent;
- }
- // if reusing agent across request and tunneling agent isn't assigned create a new agent
- if (this._keepAlive && !agent) {
- const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
- agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
- this._agent = agent;
- }
- // if not using private agent and tunnel agent isn't setup then use global agent
- if (!agent) {
- agent = usingSsl ? https.globalAgent : http.globalAgent;
- }
- if (usingSsl && this._ignoreSslError) {
- // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
- // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
- // we have to cast it to any and change it directly
- agent.options = Object.assign(agent.options || {}, {
- rejectUnauthorized: false
- });
- }
- return agent;
- }
- _performExponentialBackoff(retryNumber) {
- retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
- const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
- return new Promise(resolve => setTimeout(() => resolve(), ms));
- }
- static dateTimeDeserializer(key, value) {
- if (typeof value === 'string') {
- let a = new Date(value);
- if (!isNaN(a.valueOf())) {
- return a;
- }
- }
- return value;
- }
- async _processResponse(res, options) {
- return new Promise(async (resolve, reject) => {
- const statusCode = res.message.statusCode;
- const response = {
- statusCode: statusCode,
- result: null,
- headers: {}
- };
- // not found leads to null obj returned
- if (statusCode == HttpCodes.NotFound) {
- resolve(response);
- }
- let obj;
- let contents;
- // get the result from the body
- try {
- contents = await res.readBody();
- if (contents && contents.length > 0) {
- if (options && options.deserializeDates) {
- obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
- }
- else {
- obj = JSON.parse(contents);
- }
- response.result = obj;
- }
- response.headers = res.message.headers;
- }
- catch (err) {
- // Invalid resource (contents not json); leaving result obj null
- }
- // note that 3xx redirects are handled by the http layer.
- if (statusCode > 299) {
- let msg;
- // if exception/error in body, attempt to get better error
- if (obj && obj.message) {
- msg = obj.message;
- }
- else if (contents && contents.length > 0) {
- // it may be the case that the exception is in the body message as string
- msg = contents;
- }
- else {
- msg = 'Failed request: (' + statusCode + ')';
- }
- let err = new HttpClientError(msg, statusCode);
- err.result = response.result;
- reject(err);
- }
- else {
- resolve(response);
- }
- });
- }
-}
-exports.HttpClient = HttpClient;
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/interfaces.d.ts b/node_modules/@actions/artifact/node_modules/@actions/http-client/interfaces.d.ts
deleted file mode 100644
index 78bd85b34..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/interfaces.d.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-///
-import http = require('http');
-export interface IHeaders {
- [key: string]: any;
-}
-export interface IHttpClient {
- options(requestUrl: string, additionalHeaders?: IHeaders): Promise;
- get(requestUrl: string, additionalHeaders?: IHeaders): Promise;
- del(requestUrl: string, additionalHeaders?: IHeaders): Promise;
- post(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise;
- patch(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise;
- put(requestUrl: string, data: string, additionalHeaders?: IHeaders): Promise;
- sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: IHeaders): Promise;
- request(verb: string, requestUrl: string, data: string | NodeJS.ReadableStream, headers: IHeaders): Promise;
- requestRaw(info: IRequestInfo, data: string | NodeJS.ReadableStream): Promise;
- requestRawWithCallback(info: IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: IHttpClientResponse) => void): void;
-}
-export interface IRequestHandler {
- prepareRequest(options: http.RequestOptions): void;
- canHandleAuthentication(response: IHttpClientResponse): boolean;
- handleAuthentication(httpClient: IHttpClient, requestInfo: IRequestInfo, objs: any): Promise;
-}
-export interface IHttpClientResponse {
- message: http.IncomingMessage;
- readBody(): Promise;
-}
-export interface IRequestInfo {
- options: http.RequestOptions;
- parsedUrl: URL;
- httpModule: any;
-}
-export interface IRequestOptions {
- headers?: IHeaders;
- socketTimeout?: number;
- ignoreSslError?: boolean;
- allowRedirects?: boolean;
- allowRedirectDowngrade?: boolean;
- maxRedirects?: number;
- maxSockets?: number;
- keepAlive?: boolean;
- deserializeDates?: boolean;
- allowRetries?: boolean;
- maxRetries?: number;
-}
-export interface ITypedResponse {
- statusCode: number;
- result: T | null;
- headers: Object;
-}
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/interfaces.js b/node_modules/@actions/artifact/node_modules/@actions/http-client/interfaces.js
deleted file mode 100644
index c8ad2e549..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/interfaces.js
+++ /dev/null
@@ -1,2 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/package.json b/node_modules/@actions/artifact/node_modules/@actions/http-client/package.json
deleted file mode 100644
index d75dd4dd5..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/package.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "name": "@actions/http-client",
- "version": "1.0.11",
- "description": "Actions Http Client",
- "main": "index.js",
- "scripts": {
- "build": "rm -Rf ./_out && tsc && cp package*.json ./_out && cp *.md ./_out && cp LICENSE ./_out && cp actions.png ./_out",
- "test": "jest",
- "format": "prettier --write *.ts && prettier --write **/*.ts",
- "format-check": "prettier --check *.ts && prettier --check **/*.ts",
- "audit-check": "npm audit --audit-level=moderate"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/actions/http-client.git"
- },
- "keywords": [
- "Actions",
- "Http"
- ],
- "author": "GitHub, Inc.",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/actions/http-client/issues"
- },
- "homepage": "https://github.com/actions/http-client#readme",
- "devDependencies": {
- "@types/jest": "^25.1.4",
- "@types/node": "^12.12.31",
- "jest": "^25.1.0",
- "prettier": "^2.0.4",
- "proxy": "^1.0.1",
- "ts-jest": "^25.2.1",
- "typescript": "^3.8.3"
- },
- "dependencies": {
- "tunnel": "0.0.6"
- }
-}
\ No newline at end of file
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/proxy.d.ts b/node_modules/@actions/artifact/node_modules/@actions/http-client/proxy.d.ts
deleted file mode 100644
index 459986540..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/proxy.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export declare function getProxyUrl(reqUrl: URL): URL | undefined;
-export declare function checkBypass(reqUrl: URL): boolean;
diff --git a/node_modules/@actions/artifact/node_modules/@actions/http-client/proxy.js b/node_modules/@actions/artifact/node_modules/@actions/http-client/proxy.js
deleted file mode 100644
index 88f00ecd1..000000000
--- a/node_modules/@actions/artifact/node_modules/@actions/http-client/proxy.js
+++ /dev/null
@@ -1,57 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-function getProxyUrl(reqUrl) {
- let usingSsl = reqUrl.protocol === 'https:';
- let proxyUrl;
- if (checkBypass(reqUrl)) {
- return proxyUrl;
- }
- let proxyVar;
- if (usingSsl) {
- proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
- }
- else {
- proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
- }
- if (proxyVar) {
- proxyUrl = new URL(proxyVar);
- }
- return proxyUrl;
-}
-exports.getProxyUrl = getProxyUrl;
-function checkBypass(reqUrl) {
- if (!reqUrl.hostname) {
- return false;
- }
- let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
- if (!noProxy) {
- return false;
- }
- // Determine the request port
- let reqPort;
- if (reqUrl.port) {
- reqPort = Number(reqUrl.port);
- }
- else if (reqUrl.protocol === 'http:') {
- reqPort = 80;
- }
- else if (reqUrl.protocol === 'https:') {
- reqPort = 443;
- }
- // Format the request hostname and hostname with port
- let upperReqHosts = [reqUrl.hostname.toUpperCase()];
- if (typeof reqPort === 'number') {
- upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
- }
- // Compare request host against noproxy
- for (let upperNoProxyItem of noProxy
- .split(',')
- .map(x => x.trim().toUpperCase())
- .filter(x => x)) {
- if (upperReqHosts.some(x => x === upperNoProxyItem)) {
- return true;
- }
- }
- return false;
-}
-exports.checkBypass = checkBypass;
diff --git a/node_modules/@actions/http-client/RELEASES.md b/node_modules/@actions/http-client/RELEASES.md
index 79f9a5819..935178a83 100644
--- a/node_modules/@actions/http-client/RELEASES.md
+++ b/node_modules/@actions/http-client/RELEASES.md
@@ -1,5 +1,15 @@
## Releases
+## 1.0.10
+
+Contains a bug fix where proxy is defined without a user and password. see [PR here](https://github.com/actions/http-client/pull/42)
+
+## 1.0.9
+Throw HttpClientError instead of a generic Error from the \Json() helper methods when the server responds with a non-successful status code.
+
+## 1.0.8
+Fixed security issue where a redirect (e.g. 302) to another domain would pass headers. The fix was to strip the authorization header if the hostname was different. More [details in PR #27](https://github.com/actions/http-client/pull/27)
+
## 1.0.7
Update NPM dependencies and add 429 to the list of HttpCodes
@@ -13,4 +23,4 @@ Adds \Json() helper methods for json over http scenarios.
Started to add \Json() helper methods. Do not use this release for that. Use >= 1.0.5 since there was an issue with types.
## 1.0.1 to 1.0.3
-Adds proxy support.
\ No newline at end of file
+Adds proxy support.
diff --git a/node_modules/@actions/http-client/index.d.ts b/node_modules/@actions/http-client/index.d.ts
index 7cdc11554..9583dc72a 100644
--- a/node_modules/@actions/http-client/index.d.ts
+++ b/node_modules/@actions/http-client/index.d.ts
@@ -42,6 +42,11 @@ export declare enum MediaTypes {
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
export declare function getProxyUrl(serverUrl: string): string;
+export declare class HttpClientError extends Error {
+ constructor(message: string, statusCode: number);
+ statusCode: number;
+ result?: any;
+}
export declare class HttpClientResponse implements ifm.IHttpClientResponse {
constructor(message: http.IncomingMessage);
message: http.IncomingMessage;
diff --git a/node_modules/@actions/http-client/index.js b/node_modules/@actions/http-client/index.js
index e1930da87..43b2b1039 100644
--- a/node_modules/@actions/http-client/index.js
+++ b/node_modules/@actions/http-client/index.js
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const url = require("url");
const http = require("http");
const https = require("https");
const pm = require("./proxy");
@@ -49,7 +48,7 @@ var MediaTypes;
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
function getProxyUrl(serverUrl) {
- let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
+ let proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : '';
}
exports.getProxyUrl = getProxyUrl;
@@ -68,6 +67,15 @@ const HttpResponseRetryCodes = [
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
const ExponentialBackoffCeiling = 10;
const ExponentialBackoffTimeSlice = 5;
+class HttpClientError extends Error {
+ constructor(message, statusCode) {
+ super(message);
+ this.name = 'HttpClientError';
+ this.statusCode = statusCode;
+ Object.setPrototypeOf(this, HttpClientError.prototype);
+ }
+}
+exports.HttpClientError = HttpClientError;
class HttpClientResponse {
constructor(message) {
this.message = message;
@@ -86,7 +94,7 @@ class HttpClientResponse {
}
exports.HttpClientResponse = HttpClientResponse;
function isHttps(requestUrl) {
- let parsedUrl = url.parse(requestUrl);
+ let parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === 'https:';
}
exports.isHttps = isHttps;
@@ -191,7 +199,7 @@ class HttpClient {
if (this._disposed) {
throw new Error('Client has already been disposed.');
}
- let parsedUrl = url.parse(requestUrl);
+ let parsedUrl = new URL(requestUrl);
let info = this._prepareRequest(verb, parsedUrl, headers);
// Only perform retries on reads since writes may not be idempotent.
let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
@@ -230,7 +238,7 @@ class HttpClient {
// if there's no location to redirect to, we won't
break;
}
- let parsedRedirectUrl = url.parse(redirectUrl);
+ let parsedRedirectUrl = new URL(redirectUrl);
if (parsedUrl.protocol == 'https:' &&
parsedUrl.protocol != parsedRedirectUrl.protocol &&
!this._allowRedirectDowngrade) {
@@ -346,7 +354,7 @@ class HttpClient {
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
getAgent(serverUrl) {
- let parsedUrl = url.parse(serverUrl);
+ let parsedUrl = new URL(serverUrl);
return this._getAgent(parsedUrl);
}
_prepareRequest(method, requestUrl, headers) {
@@ -419,7 +427,9 @@ class HttpClient {
maxSockets: maxSockets,
keepAlive: this._keepAlive,
proxy: {
- proxyAuth: proxyUrl.auth,
+ ...((proxyUrl.username || proxyUrl.password) && {
+ proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
+ }),
host: proxyUrl.hostname,
port: proxyUrl.port
}
@@ -514,12 +524,8 @@ class HttpClient {
else {
msg = 'Failed request: (' + statusCode + ')';
}
- let err = new Error(msg);
- // attach statusCode and body obj (if available) to the error object
- err['statusCode'] = statusCode;
- if (response.result) {
- err['result'] = response.result;
- }
+ let err = new HttpClientError(msg, statusCode);
+ err.result = response.result;
reject(err);
}
else {
diff --git a/node_modules/@actions/http-client/interfaces.d.ts b/node_modules/@actions/http-client/interfaces.d.ts
index 0b348dc01..78bd85b34 100644
--- a/node_modules/@actions/http-client/interfaces.d.ts
+++ b/node_modules/@actions/http-client/interfaces.d.ts
@@ -1,6 +1,5 @@
///
import http = require('http');
-import url = require('url');
export interface IHeaders {
[key: string]: any;
}
@@ -27,7 +26,7 @@ export interface IHttpClientResponse {
}
export interface IRequestInfo {
options: http.RequestOptions;
- parsedUrl: url.Url;
+ parsedUrl: URL;
httpModule: any;
}
export interface IRequestOptions {
diff --git a/node_modules/@actions/http-client/package.json b/node_modules/@actions/http-client/package.json
index fbfec5f9d..d75dd4dd5 100644
--- a/node_modules/@actions/http-client/package.json
+++ b/node_modules/@actions/http-client/package.json
@@ -1,6 +1,6 @@
{
"name": "@actions/http-client",
- "version": "1.0.8",
+ "version": "1.0.11",
"description": "Actions Http Client",
"main": "index.js",
"scripts": {
diff --git a/node_modules/@actions/http-client/proxy.d.ts b/node_modules/@actions/http-client/proxy.d.ts
index 9995ea5de..459986540 100644
--- a/node_modules/@actions/http-client/proxy.d.ts
+++ b/node_modules/@actions/http-client/proxy.d.ts
@@ -1,4 +1,2 @@
-///
-import * as url from 'url';
-export declare function getProxyUrl(reqUrl: url.Url): url.Url | undefined;
-export declare function checkBypass(reqUrl: url.Url): boolean;
+export declare function getProxyUrl(reqUrl: URL): URL | undefined;
+export declare function checkBypass(reqUrl: URL): boolean;
diff --git a/node_modules/@actions/http-client/proxy.js b/node_modules/@actions/http-client/proxy.js
index 06936b392..88f00ecd1 100644
--- a/node_modules/@actions/http-client/proxy.js
+++ b/node_modules/@actions/http-client/proxy.js
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const url = require("url");
function getProxyUrl(reqUrl) {
let usingSsl = reqUrl.protocol === 'https:';
let proxyUrl;
@@ -15,7 +14,7 @@ function getProxyUrl(reqUrl) {
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
}
if (proxyVar) {
- proxyUrl = url.parse(proxyVar);
+ proxyUrl = new URL(proxyVar);
}
return proxyUrl;
}
diff --git a/node_modules/tunnel/.idea/encodings.xml b/node_modules/tunnel/.idea/encodings.xml
deleted file mode 100644
index 97626ba45..000000000
--- a/node_modules/tunnel/.idea/encodings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/node_modules/tunnel/.idea/modules.xml b/node_modules/tunnel/.idea/modules.xml
deleted file mode 100644
index 27bf88822..000000000
--- a/node_modules/tunnel/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/node_modules/tunnel/.idea/node-tunnel.iml b/node_modules/tunnel/.idea/node-tunnel.iml
deleted file mode 100644
index 24643cc37..000000000
--- a/node_modules/tunnel/.idea/node-tunnel.iml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/node_modules/tunnel/.idea/vcs.xml b/node_modules/tunnel/.idea/vcs.xml
deleted file mode 100644
index 94a25f7f4..000000000
--- a/node_modules/tunnel/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/node_modules/tunnel/.idea/workspace.xml b/node_modules/tunnel/.idea/workspace.xml
deleted file mode 100644
index 1a318c8f4..000000000
--- a/node_modules/tunnel/.idea/workspace.xml
+++ /dev/null
@@ -1,797 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- max
- onconne
-
-
-
-