diff options
| author | Egor Tensin <egor@tensin.name> | 2026-02-28 22:23:19 +0100 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-02-28 22:28:23 +0100 |
| commit | cf0901d753db0bf4d15baf625a6fa537978b03a9 (patch) | |
| tree | 41ae5e7f9eacdc67b9fa980596c803b9c50ca188 /node_modules/@actions/http-client/lib/index.js | |
| parent | upgrade actions/core to version 2 (diff) | |
| download | cleanup-path-cf0901d753db0bf4d15baf625a6fa537978b03a9.tar.gz cleanup-path-cf0901d753db0bf4d15baf625a6fa537978b03a9.zip | |
The relevant changes are in clean.js/restore.js. I'm very, very far away
from the entire Javascript infrastructure, and absolutely don't
understand why this changes were necessary. Thanks, ChatGPT! Supposedly,
this has something to do with the actions/core's transition to ESM or
whatever.
Diffstat (limited to 'node_modules/@actions/http-client/lib/index.js')
| -rw-r--r-- | node_modules/@actions/http-client/lib/index.js | 75 |
1 files changed, 17 insertions, 58 deletions
diff --git a/node_modules/@actions/http-client/lib/index.js b/node_modules/@actions/http-client/lib/index.js index d9b69a2..2c32561 100644 --- a/node_modules/@actions/http-client/lib/index.js +++ b/node_modules/@actions/http-client/lib/index.js @@ -1,38 +1,4 @@ -"use strict"; /* eslint-disable @typescript-eslint/no-explicit-any */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -42,16 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -exports.getProxyUrl = getProxyUrl; -exports.isHttps = isHttps; -const http = __importStar(require("http")); -const https = __importStar(require("https")); -const pm = __importStar(require("./proxy")); -const tunnel = __importStar(require("tunnel")); -const undici_1 = require("undici"); -var HttpCodes; +import * as http from 'http'; +import * as https from 'https'; +import * as pm from './proxy.js'; +import * as tunnel from 'tunnel'; +import { ProxyAgent } from 'undici'; +export var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; @@ -80,21 +42,21 @@ var HttpCodes; HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); -var Headers; +})(HttpCodes || (HttpCodes = {})); +export var Headers; (function (Headers) { Headers["Accept"] = "accept"; Headers["ContentType"] = "content-type"; -})(Headers || (exports.Headers = Headers = {})); -var MediaTypes; +})(Headers || (Headers = {})); +export var MediaTypes; (function (MediaTypes) { MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes || (exports.MediaTypes = MediaTypes = {})); +})(MediaTypes || (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) { +export function getProxyUrl(serverUrl) { const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ''; } @@ -113,7 +75,7 @@ const HttpResponseRetryCodes = [ const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; const ExponentialBackoffCeiling = 10; const ExponentialBackoffTimeSlice = 5; -class HttpClientError extends Error { +export class HttpClientError extends Error { constructor(message, statusCode) { super(message); this.name = 'HttpClientError'; @@ -121,8 +83,7 @@ class HttpClientError extends Error { Object.setPrototypeOf(this, HttpClientError.prototype); } } -exports.HttpClientError = HttpClientError; -class HttpClientResponse { +export class HttpClientResponse { constructor(message) { this.message = message; } @@ -153,12 +114,11 @@ class HttpClientResponse { }); } } -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { +export function isHttps(requestUrl) { const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === 'https:'; } -class HttpClient { +export class HttpClient { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; this._allowRedirects = true; @@ -634,7 +594,7 @@ class HttpClient { return proxyAgent; } const usingSsl = parsedUrl.protocol === 'https:'; - proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { + proxyAgent = new ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` }))); this._proxyAgentDispatcher = proxyAgent; @@ -732,6 +692,5 @@ class HttpClient { }); } } -exports.HttpClient = HttpClient; const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); //# sourceMappingURL=index.js.map
\ No newline at end of file |
