Follow redirects
This commit is contained in:
parent
d70300d9f5
commit
df0590b2ee
340 changed files with 17786 additions and 16731 deletions
4
lib/tools-download.js
generated
4
lib/tools-download.js
generated
|
|
@ -24,10 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.downloadAndExtract = downloadAndExtract;
|
||||
const https = __importStar(require("https"));
|
||||
const path = __importStar(require("path"));
|
||||
const perf_hooks_1 = require("perf_hooks");
|
||||
const toolcache = __importStar(require("@actions/tool-cache"));
|
||||
const follow_redirects_1 = require("follow-redirects");
|
||||
const uuid_1 = require("uuid");
|
||||
const feature_flags_1 = require("./feature-flags");
|
||||
const tar = __importStar(require("./tar"));
|
||||
|
|
@ -81,7 +81,7 @@ async function downloadAndExtract(codeqlURL, authorization, headers, tarVersion,
|
|||
}
|
||||
async function downloadAndExtractZstdWithStreaming(codeqlURL, authorization, headers, tarVersion, logger) {
|
||||
headers = Object.assign({ "User-Agent": "CodeQL Action", authorization }, headers);
|
||||
const response = await new Promise((resolve) => https.get(codeqlURL, { headers }, (r) => resolve(r)));
|
||||
const response = await new Promise((resolve) => follow_redirects_1.https.get(codeqlURL, { headers }, (r) => resolve(r)));
|
||||
if (response.statusCode !== 200) {
|
||||
throw new Error(`Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"tools-download.js","sourceRoot":"","sources":["../src/tools-download.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,gDA2FC;AArID,6CAA+B;AAC/B,2CAA6B;AAC7B,2CAAyC;AAEzC,+DAAiD;AACjD,+BAAoC;AAEpC,mDAA6D;AAE7D,2CAA6B;AAC7B,iCAAqC;AAgC9B,KAAK,UAAU,kBAAkB,CACtC,SAAiB,EACjB,aAAiC,EACjC,OAA4B,EAC5B,UAAsC,EACtC,OAAe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_modules/.package-lock.json
generated
vendored
30
node_modules/.package-lock.json
generated
vendored
|
|
@ -1236,6 +1236,16 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/follow-redirects": {
|
||||
"version": "1.14.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/follow-redirects/-/follow-redirects-1.14.4.tgz",
|
||||
"integrity": "sha512-GWXfsD0Jc1RWiFmMuMFCpXMzi9L7oPDVwxUnZdg89kDNnqsRfUKXEtUYtA98A6lig1WXH/CYY/fvPW9HuN5fTA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/get-folder-size": {
|
||||
"version": "2.0.0",
|
||||
"dev": true,
|
||||
|
|
@ -3996,6 +4006,26 @@
|
|||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/for-each": {
|
||||
"version": "0.3.3",
|
||||
"dev": true,
|
||||
|
|
|
|||
21
node_modules/@types/follow-redirects/LICENSE
generated
vendored
Normal file
21
node_modules/@types/follow-redirects/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
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
|
||||
15
node_modules/@types/follow-redirects/README.md
generated
vendored
Normal file
15
node_modules/@types/follow-redirects/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Installation
|
||||
> `npm install --save @types/follow-redirects`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for follow-redirects (https://github.com/follow-redirects/follow-redirects).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/follow-redirects.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 03:09:37 GMT
|
||||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Emily Klassen](https://github.com/forivall), [Claas Ahlrichs](https://github.com/claasahl), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
||||
3
node_modules/@types/follow-redirects/http.d.ts
generated
vendored
Normal file
3
node_modules/@types/follow-redirects/http.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import { http } from ".";
|
||||
|
||||
export = http;
|
||||
3
node_modules/@types/follow-redirects/https.d.ts
generated
vendored
Normal file
3
node_modules/@types/follow-redirects/https.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import { https } from ".";
|
||||
|
||||
export = https;
|
||||
147
node_modules/@types/follow-redirects/index.d.ts
generated
vendored
Normal file
147
node_modules/@types/follow-redirects/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
/// <reference types="node" />
|
||||
|
||||
import * as coreHttp from "http";
|
||||
import * as coreHttps from "https";
|
||||
import { Writable } from "stream";
|
||||
import { URL } from "url";
|
||||
|
||||
export interface WrappableRequest {
|
||||
getHeader?(...args: any[]): any;
|
||||
setHeader(...args: any[]): any;
|
||||
removeHeader(...args: any[]): any;
|
||||
|
||||
abort?(...args: any[]): any;
|
||||
flushHeaders?(...args: any[]): any;
|
||||
setNoDelay?(...args: any[]): any;
|
||||
setSocketKeepAlive?(...args: any[]): any;
|
||||
setTimeout?(...args: any[]): any;
|
||||
}
|
||||
export interface WrappableResponse {
|
||||
statusCode?: number | undefined;
|
||||
headers: {
|
||||
location?: string | undefined;
|
||||
};
|
||||
destroy(): any;
|
||||
}
|
||||
|
||||
export interface Scheme<Options, Request extends WrappableRequest, Response> {
|
||||
request(options: Options, callback?: (res: Response) => any): Request;
|
||||
}
|
||||
|
||||
export interface RedirectableRequest<Request extends WrappableRequest, Response> extends Writable {
|
||||
setHeader: Request["setHeader"];
|
||||
removeHeader: Request["removeHeader"];
|
||||
abort: Request["abort"];
|
||||
flushHeaders: Request["flushHeaders"];
|
||||
getHeader: Request["getHeader"];
|
||||
setNoDelay: Request["setNoDelay"];
|
||||
setSocketKeepAlive: Request["setSocketKeepAlive"];
|
||||
setTimeout: Request["setTimeout"];
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "response", listener: (response: Response) => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "response", response: Response): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "response", listener: (response: Response) => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "response", listener: (response: Response) => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "response", listener: (response: Response) => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "response", listener: (response: Response) => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
}
|
||||
|
||||
export interface RedirectScheme<Options, Request extends WrappableRequest, Response> {
|
||||
/**
|
||||
* This function has two overloads:
|
||||
* ```typescript
|
||||
* request(options: string | URL | Options, callback)
|
||||
* request(url: string | URL, options: Options, callback)
|
||||
* ```
|
||||
*/
|
||||
request(
|
||||
url: string | URL | (Options & FollowOptions<Options>),
|
||||
options?: (Options & FollowOptions<Options>) | ((res: Response & FollowResponse) => void),
|
||||
callback?: (res: Response & FollowResponse) => void,
|
||||
): RedirectableRequest<Request, Response>;
|
||||
/**
|
||||
* This function has two overloads:
|
||||
* ```typescript
|
||||
* get(options: string | URL | Options, callback)
|
||||
* get(url: string | URL, options: Options, callback)
|
||||
* ```
|
||||
*/
|
||||
get(
|
||||
url: string | URL | (Options & FollowOptions<Options>),
|
||||
options?: (Options & FollowOptions<Options>) | ((res: Response & FollowResponse) => void),
|
||||
callback?: (res: Response & FollowResponse) => void,
|
||||
): RedirectableRequest<Request, Response>;
|
||||
}
|
||||
|
||||
export type Override<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
||||
export interface FollowOptions<Options> {
|
||||
followRedirects?: boolean | undefined;
|
||||
maxRedirects?: number | undefined;
|
||||
maxBodyLength?: number | undefined;
|
||||
beforeRedirect?:
|
||||
| ((options: Options & FollowOptions<Options>, responseDetails: ResponseDetails) => void)
|
||||
| undefined;
|
||||
agents?:
|
||||
| {
|
||||
http?: coreHttp.Agent | undefined;
|
||||
https?: coreHttps.Agent | undefined;
|
||||
}
|
||||
| undefined;
|
||||
trackRedirects?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface FollowResponse {
|
||||
responseUrl: string;
|
||||
redirects: Redirect[];
|
||||
}
|
||||
|
||||
export interface Redirect {
|
||||
url: string;
|
||||
headers: coreHttp.IncomingHttpHeaders;
|
||||
statusCode: number;
|
||||
}
|
||||
|
||||
export interface ResponseDetails {
|
||||
headers: coreHttp.IncomingHttpHeaders;
|
||||
}
|
||||
|
||||
export const http: Override<
|
||||
typeof coreHttp,
|
||||
RedirectScheme<coreHttp.RequestOptions, coreHttp.ClientRequest, coreHttp.IncomingMessage>
|
||||
>;
|
||||
export const https: Override<
|
||||
typeof coreHttps,
|
||||
RedirectScheme<coreHttps.RequestOptions, coreHttp.ClientRequest, coreHttp.IncomingMessage>
|
||||
>;
|
||||
|
||||
export type WrappedScheme<T extends Scheme<any, any, any>> = Override<
|
||||
T,
|
||||
RedirectScheme<
|
||||
T extends Scheme<infer Options, any, any> ? Options : never,
|
||||
T extends Scheme<any, infer Request, any> ? Request : never,
|
||||
T extends Scheme<any, any, infer Response> ? Response : never
|
||||
>
|
||||
>;
|
||||
|
||||
export function wrap<T extends { [key: string]: Scheme<any, any, any> }>(
|
||||
protocols: T,
|
||||
): {
|
||||
[K in keyof T]: WrappedScheme<T[K]>;
|
||||
};
|
||||
37
node_modules/@types/follow-redirects/package.json
generated
vendored
Normal file
37
node_modules/@types/follow-redirects/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "@types/follow-redirects",
|
||||
"version": "1.14.4",
|
||||
"description": "TypeScript definitions for follow-redirects",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/follow-redirects",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Emily Klassen",
|
||||
"githubUsername": "forivall",
|
||||
"url": "https://github.com/forivall"
|
||||
},
|
||||
{
|
||||
"name": "Claas Ahlrichs",
|
||||
"githubUsername": "claasahl",
|
||||
"url": "https://github.com/claasahl"
|
||||
},
|
||||
{
|
||||
"name": "Piotr Błażejewicz",
|
||||
"githubUsername": "peterblazejewicz",
|
||||
"url": "https://github.com/peterblazejewicz"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/follow-redirects"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "aae4331775f0d12b6291656304a64b4fc56d23a148d8ded8decf38cc252a2a2e",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
4
node_modules/@ungap/structured-clone/cjs/package.json
generated
vendored
4
node_modules/@ungap/structured-clone/cjs/package.json
generated
vendored
|
|
@ -1,3 +1 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
{"type":"commonjs"}
|
||||
4
node_modules/acorn-walk/package.json
generated
vendored
4
node_modules/acorn-walk/package.json
generated
vendored
|
|
@ -17,9 +17,7 @@
|
|||
"./package.json": "./package.json"
|
||||
},
|
||||
"version": "8.2.0",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
"engines": {"node": ">=0.4.0"},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Marijn Haverbeke",
|
||||
|
|
|
|||
4
node_modules/chainsaw/package.json
generated
vendored
4
node_modules/chainsaw/package.json
generated
vendored
|
|
@ -19,7 +19,5 @@
|
|||
],
|
||||
"author" : "James Halliday <mail@substack.net> (http://substack.net)",
|
||||
"license" : "MIT/X11",
|
||||
"engine": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
"engine" : { "node" : ">=0.4.0" }
|
||||
}
|
||||
|
|
|
|||
26
node_modules/concat-map/package.json
generated
vendored
26
node_modules/concat-map/package.json
generated
vendored
|
|
@ -33,27 +33,11 @@
|
|||
"testling" : {
|
||||
"files" : "test/*.js",
|
||||
"browsers" : {
|
||||
"ie": [
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
],
|
||||
"ff": [
|
||||
3.5,
|
||||
10,
|
||||
15
|
||||
],
|
||||
"chrome": [
|
||||
10,
|
||||
22
|
||||
],
|
||||
"safari": [
|
||||
5.1
|
||||
],
|
||||
"opera": [
|
||||
12
|
||||
]
|
||||
"ie" : [ 6, 7, 8, 9 ],
|
||||
"ff" : [ 3.5, 10, 15.0 ],
|
||||
"chrome" : [ 10, 22 ],
|
||||
"safari" : [ 5.1 ],
|
||||
"opera" : [ 12 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
38
node_modules/crc-32/package.json
generated
vendored
38
node_modules/crc-32/package.json
generated
vendored
|
|
@ -3,24 +3,15 @@
|
|||
"version": "1.2.2",
|
||||
"author": "sheetjs",
|
||||
"description": "Pure-JS CRC-32",
|
||||
"keywords": [
|
||||
"crc",
|
||||
"crc32",
|
||||
"checksum"
|
||||
],
|
||||
"keywords": [ "crc", "crc32", "checksum" ],
|
||||
"bin": {
|
||||
"crc32": "bin/crc32.njs"
|
||||
},
|
||||
"main": "crc32.js",
|
||||
"types": "types/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"types/index.d.ts"
|
||||
]
|
||||
}
|
||||
"typesVersions": { "*": { "*": ["types/index.d.ts" ] } },
|
||||
"dependencies": {
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"printj": "~1.3.1",
|
||||
"exit-on-epipe": "~1.0.1",
|
||||
|
|
@ -32,10 +23,7 @@
|
|||
"dtslint": "^0.1.2",
|
||||
"typescript": "2.2.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/SheetJS/js-crc32.git"
|
||||
},
|
||||
"repository": { "type": "git", "url": "git://github.com/SheetJS/js-crc32.git" },
|
||||
"scripts": {
|
||||
"test": "make test",
|
||||
"build": "make",
|
||||
|
|
@ -48,20 +36,8 @@
|
|||
}
|
||||
},
|
||||
"homepage": "https://sheetjs.com/",
|
||||
"files": [
|
||||
"crc32.js",
|
||||
"crc32c.js",
|
||||
"bin/crc32.njs",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"types/index.d.ts",
|
||||
"types/*.json"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/SheetJS/js-crc32/issues"
|
||||
},
|
||||
"files": ["crc32.js", "crc32c.js", "bin/crc32.njs", "LICENSE", "README.md", "types/index.d.ts", "types/*.json"],
|
||||
"bugs": { "url": "https://github.com/SheetJS/js-crc32/issues" },
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
"engines": { "node": ">=0.8" }
|
||||
}
|
||||
|
|
|
|||
6
node_modules/eslint-config-prettier/package.json
generated
vendored
6
node_modules/eslint-config-prettier/package.json
generated
vendored
|
|
@ -6,11 +6,7 @@
|
|||
"description": "Turns off all rules that are unnecessary or might conflict with Prettier.",
|
||||
"repository": "prettier/eslint-config-prettier",
|
||||
"bin": "bin/cli.js",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
"eslintconfig",
|
||||
"prettier"
|
||||
],
|
||||
"keywords": ["eslint", "eslintconfig", "prettier"],
|
||||
"peerDependencies": {
|
||||
"eslint": ">=7.0.0"
|
||||
}
|
||||
|
|
|
|||
9
node_modules/fast-xml-parser/package.json
generated
vendored
9
node_modules/fast-xml-parser/package.json
generated
vendored
|
|
@ -60,16 +60,13 @@
|
|||
"webpack-cli": "^4.9.1"
|
||||
},
|
||||
"typings": "src/fxp.d.ts",
|
||||
"funding": [
|
||||
{
|
||||
"funding": [{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/NaturalIntelligence"
|
||||
},
|
||||
{
|
||||
},{
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/naturalintelligence"
|
||||
}
|
||||
],
|
||||
}],
|
||||
"dependencies": {
|
||||
"strnum": "^1.0.5"
|
||||
}
|
||||
|
|
|
|||
4
node_modules/flatted/cjs/package.json
generated
vendored
4
node_modules/flatted/cjs/package.json
generated
vendored
|
|
@ -1,3 +1 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
{"type":"commonjs"}
|
||||
18
node_modules/follow-redirects/LICENSE
generated
vendored
Normal file
18
node_modules/follow-redirects/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Copyright 2014–present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh
|
||||
|
||||
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.
|
||||
155
node_modules/follow-redirects/README.md
generated
vendored
Normal file
155
node_modules/follow-redirects/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
## Follow Redirects
|
||||
|
||||
Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects.
|
||||
|
||||
[](https://www.npmjs.com/package/follow-redirects)
|
||||
[](https://github.com/follow-redirects/follow-redirects/actions)
|
||||
[](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master)
|
||||
[](https://www.npmjs.com/package/follow-redirects)
|
||||
[](https://github.com/sponsors/RubenVerborgh)
|
||||
|
||||
`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback)
|
||||
methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback)
|
||||
modules, with the exception that they will seamlessly follow redirects.
|
||||
|
||||
```javascript
|
||||
const { http, https } = require('follow-redirects');
|
||||
|
||||
http.get('http://bit.ly/900913', response => {
|
||||
response.on('data', chunk => {
|
||||
console.log(chunk);
|
||||
});
|
||||
}).on('error', err => {
|
||||
console.error(err);
|
||||
});
|
||||
```
|
||||
|
||||
You can inspect the final redirected URL through the `responseUrl` property on the `response`.
|
||||
If no redirection happened, `responseUrl` is the original request URL.
|
||||
|
||||
```javascript
|
||||
const request = https.request({
|
||||
host: 'bitly.com',
|
||||
path: '/UHfDGO',
|
||||
}, response => {
|
||||
console.log(response.responseUrl);
|
||||
// 'http://duckduckgo.com/robots.txt'
|
||||
});
|
||||
request.end();
|
||||
```
|
||||
|
||||
## Options
|
||||
### Global options
|
||||
Global options are set directly on the `follow-redirects` module:
|
||||
|
||||
```javascript
|
||||
const followRedirects = require('follow-redirects');
|
||||
followRedirects.maxRedirects = 10;
|
||||
followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB
|
||||
```
|
||||
|
||||
The following global options are supported:
|
||||
|
||||
- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
|
||||
|
||||
- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
|
||||
|
||||
### Per-request options
|
||||
Per-request options are set by passing an `options` object:
|
||||
|
||||
```javascript
|
||||
const url = require('url');
|
||||
const { http, https } = require('follow-redirects');
|
||||
|
||||
const options = url.parse('http://bit.ly/900913');
|
||||
options.maxRedirects = 10;
|
||||
options.beforeRedirect = (options, response, request) => {
|
||||
// Use this to adjust the request options upon redirecting,
|
||||
// to inspect the latest response headers,
|
||||
// or to cancel the request by throwing an error
|
||||
|
||||
// response.headers = the redirect response headers
|
||||
// response.statusCode = the redirect response code (eg. 301, 307, etc.)
|
||||
|
||||
// request.url = the requested URL that resulted in a redirect
|
||||
// request.headers = the headers in the request that resulted in a redirect
|
||||
// request.method = the method of the request that resulted in a redirect
|
||||
if (options.hostname === "example.com") {
|
||||
options.auth = "user:password";
|
||||
}
|
||||
};
|
||||
http.request(options);
|
||||
```
|
||||
|
||||
In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback),
|
||||
the following per-request options are supported:
|
||||
- `followRedirects` (default: `true`) – whether redirects should be followed.
|
||||
|
||||
- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
|
||||
|
||||
- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
|
||||
|
||||
- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error.
|
||||
|
||||
- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }`
|
||||
|
||||
- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object.
|
||||
|
||||
|
||||
### Advanced usage
|
||||
By default, `follow-redirects` will use the Node.js default implementations
|
||||
of [`http`](https://nodejs.org/api/http.html)
|
||||
and [`https`](https://nodejs.org/api/https.html).
|
||||
To enable features such as caching and/or intermediate request tracking,
|
||||
you might instead want to wrap `follow-redirects` around custom protocol implementations:
|
||||
|
||||
```javascript
|
||||
const { http, https } = require('follow-redirects').wrap({
|
||||
http: require('your-custom-http'),
|
||||
https: require('your-custom-https'),
|
||||
});
|
||||
```
|
||||
|
||||
Such custom protocols only need an implementation of the `request` method.
|
||||
|
||||
## Browser Usage
|
||||
|
||||
Due to the way the browser works,
|
||||
the `http` and `https` browser equivalents perform redirects by default.
|
||||
|
||||
By requiring `follow-redirects` this way:
|
||||
```javascript
|
||||
const http = require('follow-redirects/http');
|
||||
const https = require('follow-redirects/https');
|
||||
```
|
||||
you can easily tell webpack and friends to replace
|
||||
`follow-redirect` by the built-in versions:
|
||||
|
||||
```json
|
||||
{
|
||||
"follow-redirects/http" : "http",
|
||||
"follow-redirects/https" : "https"
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues)
|
||||
detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied
|
||||
by tests. You can run the test suite locally with a simple `npm test` command.
|
||||
|
||||
## Debug Logging
|
||||
|
||||
`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging
|
||||
set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test
|
||||
suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well.
|
||||
|
||||
## Authors
|
||||
|
||||
- [Ruben Verborgh](https://ruben.verborgh.org/)
|
||||
- [Olivier Lalonde](mailto:olalonde@gmail.com)
|
||||
- [James Talmage](mailto:james@talmage.io)
|
||||
|
||||
## License
|
||||
|
||||
[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE)
|
||||
15
node_modules/follow-redirects/debug.js
generated
vendored
Normal file
15
node_modules/follow-redirects/debug.js
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
var debug;
|
||||
|
||||
module.exports = function () {
|
||||
if (!debug) {
|
||||
try {
|
||||
/* eslint global-require: off */
|
||||
debug = require("debug")("follow-redirects");
|
||||
}
|
||||
catch (error) { /* */ }
|
||||
if (typeof debug !== "function") {
|
||||
debug = function () { /* */ };
|
||||
}
|
||||
}
|
||||
debug.apply(null, arguments);
|
||||
};
|
||||
1
node_modules/follow-redirects/http.js
generated
vendored
Normal file
1
node_modules/follow-redirects/http.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
module.exports = require("./").http;
|
||||
1
node_modules/follow-redirects/https.js
generated
vendored
Normal file
1
node_modules/follow-redirects/https.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
module.exports = require("./").https;
|
||||
686
node_modules/follow-redirects/index.js
generated
vendored
Normal file
686
node_modules/follow-redirects/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,686 @@
|
|||
var url = require("url");
|
||||
var URL = url.URL;
|
||||
var http = require("http");
|
||||
var https = require("https");
|
||||
var Writable = require("stream").Writable;
|
||||
var assert = require("assert");
|
||||
var debug = require("./debug");
|
||||
|
||||
// Preventive platform detection
|
||||
// istanbul ignore next
|
||||
(function detectUnsupportedEnvironment() {
|
||||
var looksLikeNode = typeof process !== "undefined";
|
||||
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
||||
var looksLikeV8 = isFunction(Error.captureStackTrace);
|
||||
if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
|
||||
console.warn("The follow-redirects package should be excluded from browser builds.");
|
||||
}
|
||||
}());
|
||||
|
||||
// Whether to use the native URL object or the legacy url module
|
||||
var useNativeURL = false;
|
||||
try {
|
||||
assert(new URL(""));
|
||||
}
|
||||
catch (error) {
|
||||
useNativeURL = error.code === "ERR_INVALID_URL";
|
||||
}
|
||||
|
||||
// URL fields to preserve in copy operations
|
||||
var preservedUrlFields = [
|
||||
"auth",
|
||||
"host",
|
||||
"hostname",
|
||||
"href",
|
||||
"path",
|
||||
"pathname",
|
||||
"port",
|
||||
"protocol",
|
||||
"query",
|
||||
"search",
|
||||
"hash",
|
||||
];
|
||||
|
||||
// Create handlers that pass events from native requests
|
||||
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
||||
var eventHandlers = Object.create(null);
|
||||
events.forEach(function (event) {
|
||||
eventHandlers[event] = function (arg1, arg2, arg3) {
|
||||
this._redirectable.emit(event, arg1, arg2, arg3);
|
||||
};
|
||||
});
|
||||
|
||||
// Error types with codes
|
||||
var InvalidUrlError = createErrorType(
|
||||
"ERR_INVALID_URL",
|
||||
"Invalid URL",
|
||||
TypeError
|
||||
);
|
||||
var RedirectionError = createErrorType(
|
||||
"ERR_FR_REDIRECTION_FAILURE",
|
||||
"Redirected request failed"
|
||||
);
|
||||
var TooManyRedirectsError = createErrorType(
|
||||
"ERR_FR_TOO_MANY_REDIRECTS",
|
||||
"Maximum number of redirects exceeded",
|
||||
RedirectionError
|
||||
);
|
||||
var MaxBodyLengthExceededError = createErrorType(
|
||||
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
||||
"Request body larger than maxBodyLength limit"
|
||||
);
|
||||
var WriteAfterEndError = createErrorType(
|
||||
"ERR_STREAM_WRITE_AFTER_END",
|
||||
"write after end"
|
||||
);
|
||||
|
||||
// istanbul ignore next
|
||||
var destroy = Writable.prototype.destroy || noop;
|
||||
|
||||
// An HTTP(S) request that can be redirected
|
||||
function RedirectableRequest(options, responseCallback) {
|
||||
// Initialize the request
|
||||
Writable.call(this);
|
||||
this._sanitizeOptions(options);
|
||||
this._options = options;
|
||||
this._ended = false;
|
||||
this._ending = false;
|
||||
this._redirectCount = 0;
|
||||
this._redirects = [];
|
||||
this._requestBodyLength = 0;
|
||||
this._requestBodyBuffers = [];
|
||||
|
||||
// Attach a callback if passed
|
||||
if (responseCallback) {
|
||||
this.on("response", responseCallback);
|
||||
}
|
||||
|
||||
// React to responses of native requests
|
||||
var self = this;
|
||||
this._onNativeResponse = function (response) {
|
||||
try {
|
||||
self._processResponse(response);
|
||||
}
|
||||
catch (cause) {
|
||||
self.emit("error", cause instanceof RedirectionError ?
|
||||
cause : new RedirectionError({ cause: cause }));
|
||||
}
|
||||
};
|
||||
|
||||
// Perform the first request
|
||||
this._performRequest();
|
||||
}
|
||||
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
||||
|
||||
RedirectableRequest.prototype.abort = function () {
|
||||
destroyRequest(this._currentRequest);
|
||||
this._currentRequest.abort();
|
||||
this.emit("abort");
|
||||
};
|
||||
|
||||
RedirectableRequest.prototype.destroy = function (error) {
|
||||
destroyRequest(this._currentRequest, error);
|
||||
destroy.call(this, error);
|
||||
return this;
|
||||
};
|
||||
|
||||
// Writes buffered data to the current native request
|
||||
RedirectableRequest.prototype.write = function (data, encoding, callback) {
|
||||
// Writing is not allowed if end has been called
|
||||
if (this._ending) {
|
||||
throw new WriteAfterEndError();
|
||||
}
|
||||
|
||||
// Validate input and shift parameters if necessary
|
||||
if (!isString(data) && !isBuffer(data)) {
|
||||
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
||||
}
|
||||
if (isFunction(encoding)) {
|
||||
callback = encoding;
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
// Ignore empty buffers, since writing them doesn't invoke the callback
|
||||
// https://github.com/nodejs/node/issues/22066
|
||||
if (data.length === 0) {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Only write when we don't exceed the maximum body length
|
||||
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
|
||||
this._requestBodyLength += data.length;
|
||||
this._requestBodyBuffers.push({ data: data, encoding: encoding });
|
||||
this._currentRequest.write(data, encoding, callback);
|
||||
}
|
||||
// Error when we exceed the maximum body length
|
||||
else {
|
||||
this.emit("error", new MaxBodyLengthExceededError());
|
||||
this.abort();
|
||||
}
|
||||
};
|
||||
|
||||
// Ends the current native request
|
||||
RedirectableRequest.prototype.end = function (data, encoding, callback) {
|
||||
// Shift parameters if necessary
|
||||
if (isFunction(data)) {
|
||||
callback = data;
|
||||
data = encoding = null;
|
||||
}
|
||||
else if (isFunction(encoding)) {
|
||||
callback = encoding;
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
// Write data if needed and end
|
||||
if (!data) {
|
||||
this._ended = this._ending = true;
|
||||
this._currentRequest.end(null, null, callback);
|
||||
}
|
||||
else {
|
||||
var self = this;
|
||||
var currentRequest = this._currentRequest;
|
||||
this.write(data, encoding, function () {
|
||||
self._ended = true;
|
||||
currentRequest.end(null, null, callback);
|
||||
});
|
||||
this._ending = true;
|
||||
}
|
||||
};
|
||||
|
||||
// Sets a header value on the current native request
|
||||
RedirectableRequest.prototype.setHeader = function (name, value) {
|
||||
this._options.headers[name] = value;
|
||||
this._currentRequest.setHeader(name, value);
|
||||
};
|
||||
|
||||
// Clears a header value on the current native request
|
||||
RedirectableRequest.prototype.removeHeader = function (name) {
|
||||
delete this._options.headers[name];
|
||||
this._currentRequest.removeHeader(name);
|
||||
};
|
||||
|
||||
// Global timeout for all underlying requests
|
||||
RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
||||
var self = this;
|
||||
|
||||
// Destroys the socket on timeout
|
||||
function destroyOnTimeout(socket) {
|
||||
socket.setTimeout(msecs);
|
||||
socket.removeListener("timeout", socket.destroy);
|
||||
socket.addListener("timeout", socket.destroy);
|
||||
}
|
||||
|
||||
// Sets up a timer to trigger a timeout event
|
||||
function startTimer(socket) {
|
||||
if (self._timeout) {
|
||||
clearTimeout(self._timeout);
|
||||
}
|
||||
self._timeout = setTimeout(function () {
|
||||
self.emit("timeout");
|
||||
clearTimer();
|
||||
}, msecs);
|
||||
destroyOnTimeout(socket);
|
||||
}
|
||||
|
||||
// Stops a timeout from triggering
|
||||
function clearTimer() {
|
||||
// Clear the timeout
|
||||
if (self._timeout) {
|
||||
clearTimeout(self._timeout);
|
||||
self._timeout = null;
|
||||
}
|
||||
|
||||
// Clean up all attached listeners
|
||||
self.removeListener("abort", clearTimer);
|
||||
self.removeListener("error", clearTimer);
|
||||
self.removeListener("response", clearTimer);
|
||||
self.removeListener("close", clearTimer);
|
||||
if (callback) {
|
||||
self.removeListener("timeout", callback);
|
||||
}
|
||||
if (!self.socket) {
|
||||
self._currentRequest.removeListener("socket", startTimer);
|
||||
}
|
||||
}
|
||||
|
||||
// Attach callback if passed
|
||||
if (callback) {
|
||||
this.on("timeout", callback);
|
||||
}
|
||||
|
||||
// Start the timer if or when the socket is opened
|
||||
if (this.socket) {
|
||||
startTimer(this.socket);
|
||||
}
|
||||
else {
|
||||
this._currentRequest.once("socket", startTimer);
|
||||
}
|
||||
|
||||
// Clean up on events
|
||||
this.on("socket", destroyOnTimeout);
|
||||
this.on("abort", clearTimer);
|
||||
this.on("error", clearTimer);
|
||||
this.on("response", clearTimer);
|
||||
this.on("close", clearTimer);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// Proxy all other public ClientRequest methods
|
||||
[
|
||||
"flushHeaders", "getHeader",
|
||||
"setNoDelay", "setSocketKeepAlive",
|
||||
].forEach(function (method) {
|
||||
RedirectableRequest.prototype[method] = function (a, b) {
|
||||
return this._currentRequest[method](a, b);
|
||||
};
|
||||
});
|
||||
|
||||
// Proxy all public ClientRequest properties
|
||||
["aborted", "connection", "socket"].forEach(function (property) {
|
||||
Object.defineProperty(RedirectableRequest.prototype, property, {
|
||||
get: function () { return this._currentRequest[property]; },
|
||||
});
|
||||
});
|
||||
|
||||
RedirectableRequest.prototype._sanitizeOptions = function (options) {
|
||||
// Ensure headers are always present
|
||||
if (!options.headers) {
|
||||
options.headers = {};
|
||||
}
|
||||
|
||||
// Since http.request treats host as an alias of hostname,
|
||||
// but the url module interprets host as hostname plus port,
|
||||
// eliminate the host property to avoid confusion.
|
||||
if (options.host) {
|
||||
// Use hostname if set, because it has precedence
|
||||
if (!options.hostname) {
|
||||
options.hostname = options.host;
|
||||
}
|
||||
delete options.host;
|
||||
}
|
||||
|
||||
// Complete the URL object when necessary
|
||||
if (!options.pathname && options.path) {
|
||||
var searchPos = options.path.indexOf("?");
|
||||
if (searchPos < 0) {
|
||||
options.pathname = options.path;
|
||||
}
|
||||
else {
|
||||
options.pathname = options.path.substring(0, searchPos);
|
||||
options.search = options.path.substring(searchPos);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Executes the next native request (initial or redirect)
|
||||
RedirectableRequest.prototype._performRequest = function () {
|
||||
// Load the native protocol
|
||||
var protocol = this._options.protocol;
|
||||
var nativeProtocol = this._options.nativeProtocols[protocol];
|
||||
if (!nativeProtocol) {
|
||||
throw new TypeError("Unsupported protocol " + protocol);
|
||||
}
|
||||
|
||||
// If specified, use the agent corresponding to the protocol
|
||||
// (HTTP and HTTPS use different types of agents)
|
||||
if (this._options.agents) {
|
||||
var scheme = protocol.slice(0, -1);
|
||||
this._options.agent = this._options.agents[scheme];
|
||||
}
|
||||
|
||||
// Create the native request and set up its event handlers
|
||||
var request = this._currentRequest =
|
||||
nativeProtocol.request(this._options, this._onNativeResponse);
|
||||
request._redirectable = this;
|
||||
for (var event of events) {
|
||||
request.on(event, eventHandlers[event]);
|
||||
}
|
||||
|
||||
// RFC7230§5.3.1: When making a request directly to an origin server, […]
|
||||
// a client MUST send only the absolute path […] as the request-target.
|
||||
this._currentUrl = /^\//.test(this._options.path) ?
|
||||
url.format(this._options) :
|
||||
// When making a request to a proxy, […]
|
||||
// a client MUST send the target URI in absolute-form […].
|
||||
this._options.path;
|
||||
|
||||
// End a redirected request
|
||||
// (The first request must be ended explicitly with RedirectableRequest#end)
|
||||
if (this._isRedirect) {
|
||||
// Write the request entity and end
|
||||
var i = 0;
|
||||
var self = this;
|
||||
var buffers = this._requestBodyBuffers;
|
||||
(function writeNext(error) {
|
||||
// Only write if this request has not been redirected yet
|
||||
// istanbul ignore else
|
||||
if (request === self._currentRequest) {
|
||||
// Report any write errors
|
||||
// istanbul ignore if
|
||||
if (error) {
|
||||
self.emit("error", error);
|
||||
}
|
||||
// Write the next buffer if there are still left
|
||||
else if (i < buffers.length) {
|
||||
var buffer = buffers[i++];
|
||||
// istanbul ignore else
|
||||
if (!request.finished) {
|
||||
request.write(buffer.data, buffer.encoding, writeNext);
|
||||
}
|
||||
}
|
||||
// End the request if `end` has been called on us
|
||||
else if (self._ended) {
|
||||
request.end();
|
||||
}
|
||||
}
|
||||
}());
|
||||
}
|
||||
};
|
||||
|
||||
// Processes a response from the current native request
|
||||
RedirectableRequest.prototype._processResponse = function (response) {
|
||||
// Store the redirected response
|
||||
var statusCode = response.statusCode;
|
||||
if (this._options.trackRedirects) {
|
||||
this._redirects.push({
|
||||
url: this._currentUrl,
|
||||
headers: response.headers,
|
||||
statusCode: statusCode,
|
||||
});
|
||||
}
|
||||
|
||||
// RFC7231§6.4: The 3xx (Redirection) class of status code indicates
|
||||
// that further action needs to be taken by the user agent in order to
|
||||
// fulfill the request. If a Location header field is provided,
|
||||
// the user agent MAY automatically redirect its request to the URI
|
||||
// referenced by the Location field value,
|
||||
// even if the specific status code is not understood.
|
||||
|
||||
// If the response is not a redirect; return it as-is
|
||||
var location = response.headers.location;
|
||||
if (!location || this._options.followRedirects === false ||
|
||||
statusCode < 300 || statusCode >= 400) {
|
||||
response.responseUrl = this._currentUrl;
|
||||
response.redirects = this._redirects;
|
||||
this.emit("response", response);
|
||||
|
||||
// Clean up
|
||||
this._requestBodyBuffers = [];
|
||||
return;
|
||||
}
|
||||
|
||||
// The response is a redirect, so abort the current request
|
||||
destroyRequest(this._currentRequest);
|
||||
// Discard the remainder of the response to avoid waiting for data
|
||||
response.destroy();
|
||||
|
||||
// RFC7231§6.4: A client SHOULD detect and intervene
|
||||
// in cyclical redirections (i.e., "infinite" redirection loops).
|
||||
if (++this._redirectCount > this._options.maxRedirects) {
|
||||
throw new TooManyRedirectsError();
|
||||
}
|
||||
|
||||
// Store the request headers if applicable
|
||||
var requestHeaders;
|
||||
var beforeRedirect = this._options.beforeRedirect;
|
||||
if (beforeRedirect) {
|
||||
requestHeaders = Object.assign({
|
||||
// The Host header was set by nativeProtocol.request
|
||||
Host: response.req.getHeader("host"),
|
||||
}, this._options.headers);
|
||||
}
|
||||
|
||||
// RFC7231§6.4: Automatic redirection needs to done with
|
||||
// care for methods not known to be safe, […]
|
||||
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
||||
// the request method from POST to GET for the subsequent request.
|
||||
var method = this._options.method;
|
||||
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
||||
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
||||
// the server is redirecting the user agent to a different resource […]
|
||||
// A user agent can perform a retrieval request targeting that URI
|
||||
// (a GET or HEAD request if using HTTP) […]
|
||||
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
||||
this._options.method = "GET";
|
||||
// Drop a possible entity and headers related to it
|
||||
this._requestBodyBuffers = [];
|
||||
removeMatchingHeaders(/^content-/i, this._options.headers);
|
||||
}
|
||||
|
||||
// Drop the Host header, as the redirect might lead to a different host
|
||||
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
||||
|
||||
// If the redirect is relative, carry over the host of the last request
|
||||
var currentUrlParts = parseUrl(this._currentUrl);
|
||||
var currentHost = currentHostHeader || currentUrlParts.host;
|
||||
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
|
||||
url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
||||
|
||||
// Create the redirected request
|
||||
var redirectUrl = resolveUrl(location, currentUrl);
|
||||
debug("redirecting to", redirectUrl.href);
|
||||
this._isRedirect = true;
|
||||
spreadUrlObject(redirectUrl, this._options);
|
||||
|
||||
// Drop confidential headers when redirecting to a less secure protocol
|
||||
// or to a different domain that is not a superdomain
|
||||
if (redirectUrl.protocol !== currentUrlParts.protocol &&
|
||||
redirectUrl.protocol !== "https:" ||
|
||||
redirectUrl.host !== currentHost &&
|
||||
!isSubdomain(redirectUrl.host, currentHost)) {
|
||||
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
|
||||
}
|
||||
|
||||
// Evaluate the beforeRedirect callback
|
||||
if (isFunction(beforeRedirect)) {
|
||||
var responseDetails = {
|
||||
headers: response.headers,
|
||||
statusCode: statusCode,
|
||||
};
|
||||
var requestDetails = {
|
||||
url: currentUrl,
|
||||
method: method,
|
||||
headers: requestHeaders,
|
||||
};
|
||||
beforeRedirect(this._options, responseDetails, requestDetails);
|
||||
this._sanitizeOptions(this._options);
|
||||
}
|
||||
|
||||
// Perform the redirected request
|
||||
this._performRequest();
|
||||
};
|
||||
|
||||
// Wraps the key/value object of protocols with redirect functionality
|
||||
function wrap(protocols) {
|
||||
// Default settings
|
||||
var exports = {
|
||||
maxRedirects: 21,
|
||||
maxBodyLength: 10 * 1024 * 1024,
|
||||
};
|
||||
|
||||
// Wrap each protocol
|
||||
var nativeProtocols = {};
|
||||
Object.keys(protocols).forEach(function (scheme) {
|
||||
var protocol = scheme + ":";
|
||||
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
||||
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
|
||||
|
||||
// Executes a request, following redirects
|
||||
function request(input, options, callback) {
|
||||
// Parse parameters, ensuring that input is an object
|
||||
if (isURL(input)) {
|
||||
input = spreadUrlObject(input);
|
||||
}
|
||||
else if (isString(input)) {
|
||||
input = spreadUrlObject(parseUrl(input));
|
||||
}
|
||||
else {
|
||||
callback = options;
|
||||
options = validateUrl(input);
|
||||
input = { protocol: protocol };
|
||||
}
|
||||
if (isFunction(options)) {
|
||||
callback = options;
|
||||
options = null;
|
||||
}
|
||||
|
||||
// Set defaults
|
||||
options = Object.assign({
|
||||
maxRedirects: exports.maxRedirects,
|
||||
maxBodyLength: exports.maxBodyLength,
|
||||
}, input, options);
|
||||
options.nativeProtocols = nativeProtocols;
|
||||
if (!isString(options.host) && !isString(options.hostname)) {
|
||||
options.hostname = "::1";
|
||||
}
|
||||
|
||||
assert.equal(options.protocol, protocol, "protocol mismatch");
|
||||
debug("options", options);
|
||||
return new RedirectableRequest(options, callback);
|
||||
}
|
||||
|
||||
// Executes a GET request, following redirects
|
||||
function get(input, options, callback) {
|
||||
var wrappedRequest = wrappedProtocol.request(input, options, callback);
|
||||
wrappedRequest.end();
|
||||
return wrappedRequest;
|
||||
}
|
||||
|
||||
// Expose the properties on the wrapped protocol
|
||||
Object.defineProperties(wrappedProtocol, {
|
||||
request: { value: request, configurable: true, enumerable: true, writable: true },
|
||||
get: { value: get, configurable: true, enumerable: true, writable: true },
|
||||
});
|
||||
});
|
||||
return exports;
|
||||
}
|
||||
|
||||
function noop() { /* empty */ }
|
||||
|
||||
function parseUrl(input) {
|
||||
var parsed;
|
||||
// istanbul ignore else
|
||||
if (useNativeURL) {
|
||||
parsed = new URL(input);
|
||||
}
|
||||
else {
|
||||
// Ensure the URL is valid and absolute
|
||||
parsed = validateUrl(url.parse(input));
|
||||
if (!isString(parsed.protocol)) {
|
||||
throw new InvalidUrlError({ input });
|
||||
}
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
|
||||
function resolveUrl(relative, base) {
|
||||
// istanbul ignore next
|
||||
return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
|
||||
}
|
||||
|
||||
function validateUrl(input) {
|
||||
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
||||
throw new InvalidUrlError({ input: input.href || input });
|
||||
}
|
||||
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
||||
throw new InvalidUrlError({ input: input.href || input });
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
function spreadUrlObject(urlObject, target) {
|
||||
var spread = target || {};
|
||||
for (var key of preservedUrlFields) {
|
||||
spread[key] = urlObject[key];
|
||||
}
|
||||
|
||||
// Fix IPv6 hostname
|
||||
if (spread.hostname.startsWith("[")) {
|
||||
spread.hostname = spread.hostname.slice(1, -1);
|
||||
}
|
||||
// Ensure port is a number
|
||||
if (spread.port !== "") {
|
||||
spread.port = Number(spread.port);
|
||||
}
|
||||
// Concatenate path
|
||||
spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
|
||||
|
||||
return spread;
|
||||
}
|
||||
|
||||
function removeMatchingHeaders(regex, headers) {
|
||||
var lastValue;
|
||||
for (var header in headers) {
|
||||
if (regex.test(header)) {
|
||||
lastValue = headers[header];
|
||||
delete headers[header];
|
||||
}
|
||||
}
|
||||
return (lastValue === null || typeof lastValue === "undefined") ?
|
||||
undefined : String(lastValue).trim();
|
||||
}
|
||||
|
||||
function createErrorType(code, message, baseClass) {
|
||||
// Create constructor
|
||||
function CustomError(properties) {
|
||||
// istanbul ignore else
|
||||
if (isFunction(Error.captureStackTrace)) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
}
|
||||
Object.assign(this, properties || {});
|
||||
this.code = code;
|
||||
this.message = this.cause ? message + ": " + this.cause.message : message;
|
||||
}
|
||||
|
||||
// Attach constructor and set default properties
|
||||
CustomError.prototype = new (baseClass || Error)();
|
||||
Object.defineProperties(CustomError.prototype, {
|
||||
constructor: {
|
||||
value: CustomError,
|
||||
enumerable: false,
|
||||
},
|
||||
name: {
|
||||
value: "Error [" + code + "]",
|
||||
enumerable: false,
|
||||
},
|
||||
});
|
||||
return CustomError;
|
||||
}
|
||||
|
||||
function destroyRequest(request, error) {
|
||||
for (var event of events) {
|
||||
request.removeListener(event, eventHandlers[event]);
|
||||
}
|
||||
request.on("error", noop);
|
||||
request.destroy(error);
|
||||
}
|
||||
|
||||
function isSubdomain(subdomain, domain) {
|
||||
assert(isString(subdomain) && isString(domain));
|
||||
var dot = subdomain.length - domain.length - 1;
|
||||
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
||||
}
|
||||
|
||||
function isString(value) {
|
||||
return typeof value === "string" || value instanceof String;
|
||||
}
|
||||
|
||||
function isFunction(value) {
|
||||
return typeof value === "function";
|
||||
}
|
||||
|
||||
function isBuffer(value) {
|
||||
return typeof value === "object" && ("length" in value);
|
||||
}
|
||||
|
||||
function isURL(value) {
|
||||
return URL && value instanceof URL;
|
||||
}
|
||||
|
||||
// Exports
|
||||
module.exports = wrap({ http: http, https: https });
|
||||
module.exports.wrap = wrap;
|
||||
58
node_modules/follow-redirects/package.json
generated
vendored
Normal file
58
node_modules/follow-redirects/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"name": "follow-redirects",
|
||||
"version": "1.15.9",
|
||||
"description": "HTTP and HTTPS modules that follow redirects.",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"*.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint *.js test",
|
||||
"test": "nyc mocha"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git"
|
||||
},
|
||||
"homepage": "https://github.com/follow-redirects/follow-redirects",
|
||||
"bugs": {
|
||||
"url": "https://github.com/follow-redirects/follow-redirects/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"url",
|
||||
"redirect",
|
||||
"client",
|
||||
"location",
|
||||
"utility"
|
||||
],
|
||||
"author": "Ruben Verborgh <ruben@verborgh.org> (https://ruben.verborgh.org/)",
|
||||
"contributors": [
|
||||
"Olivier Lalonde <olalonde@gmail.com> (http://www.syskall.com)",
|
||||
"James Talmage <james@talmage.io>"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"concat-stream": "^2.0.0",
|
||||
"eslint": "^5.16.0",
|
||||
"express": "^4.16.4",
|
||||
"lolex": "^3.1.0",
|
||||
"mocha": "^6.0.2",
|
||||
"nyc": "^14.1.1"
|
||||
}
|
||||
}
|
||||
6
node_modules/imurmurhash/package.json
generated
vendored
6
node_modules/imurmurhash/package.json
generated
vendored
|
|
@ -30,8 +30,10 @@
|
|||
"url": "https://github.com/homebrewing"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {},
|
||||
"devDependencies": {},
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8.19"
|
||||
}
|
||||
|
|
|
|||
3
node_modules/is-error/package.json
generated
vendored
3
node_modules/is-error/package.json
generated
vendored
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"name": "is-error",
|
||||
{ "name": "is-error",
|
||||
"version": "2.2.2",
|
||||
"description": "Detect whether a value is an error",
|
||||
"keywords": [],
|
||||
|
|
|
|||
9
node_modules/json-stable-stringify-without-jsonify/package.json
generated
vendored
9
node_modules/json-stable-stringify-without-jsonify/package.json
generated
vendored
|
|
@ -3,7 +3,8 @@
|
|||
"version": "1.0.1",
|
||||
"description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies",
|
||||
"main": "index.js",
|
||||
"dependencies": {},
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"tape": "~1.0.4"
|
||||
},
|
||||
|
|
@ -14,10 +15,8 @@
|
|||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"ff/5",
|
||||
"ff/latest",
|
||||
"chrome/15",
|
||||
"chrome/latest",
|
||||
"ff/5", "ff/latest",
|
||||
"chrome/15", "chrome/latest",
|
||||
"safari/latest",
|
||||
"opera/latest"
|
||||
]
|
||||
|
|
|
|||
4
node_modules/language-tags/package.json
generated
vendored
4
node_modules/language-tags/package.json
generated
vendored
|
|
@ -1,9 +1,7 @@
|
|||
{
|
||||
"name": "language-tags",
|
||||
"version": "1.0.5",
|
||||
"implements": [
|
||||
"CommonJS/Modules/1.0"
|
||||
],
|
||||
"implements": ["CommonJS/Modules/1.0"],
|
||||
"description": "Work with IANA language tags.",
|
||||
"main": "lib/index.js",
|
||||
"homepage": "https://github.com/mattcg/language-tags",
|
||||
|
|
|
|||
4
node_modules/lodash.camelcase/package.json
generated
vendored
4
node_modules/lodash.camelcase/package.json
generated
vendored
|
|
@ -13,7 +13,5 @@
|
|||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||
}
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
4
node_modules/lodash.get/package.json
generated
vendored
4
node_modules/lodash.get/package.json
generated
vendored
|
|
@ -13,7 +13,5 @@
|
|||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||
}
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
4
node_modules/lodash.kebabcase/package.json
generated
vendored
4
node_modules/lodash.kebabcase/package.json
generated
vendored
|
|
@ -13,7 +13,5 @@
|
|||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||
}
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
4
node_modules/lodash.merge/package.json
generated
vendored
4
node_modules/lodash.merge/package.json
generated
vendored
|
|
@ -12,7 +12,5 @@
|
|||
"Mathias Bynens <mathias@qiwi.be>"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||
}
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
4
node_modules/lodash.snakecase/package.json
generated
vendored
4
node_modules/lodash.snakecase/package.json
generated
vendored
|
|
@ -13,7 +13,5 @@
|
|||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||
}
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
4
node_modules/lodash.upperfirst/package.json
generated
vendored
4
node_modules/lodash.upperfirst/package.json
generated
vendored
|
|
@ -13,7 +13,5 @@
|
|||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
|
||||
}
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
4
node_modules/lodash/package.json
generated
vendored
4
node_modules/lodash/package.json
generated
vendored
|
|
@ -13,7 +13,5 @@
|
|||
"John-David Dalton <john.david.dalton@gmail.com>",
|
||||
"Mathias Bynens <mathias@qiwi.be>"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\""
|
||||
}
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
8
node_modules/requireindex/package.json
generated
vendored
8
node_modules/requireindex/package.json
generated
vendored
|
|
@ -4,31 +4,39 @@
|
|||
"version": "1.1.0",
|
||||
"license" : "MIT",
|
||||
"main": "index.js",
|
||||
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/stephenhandley/requireindex.git"
|
||||
},
|
||||
|
||||
"scripts": {
|
||||
"test": "node test/test.js"
|
||||
},
|
||||
|
||||
"keywords": [
|
||||
"require",
|
||||
"index",
|
||||
"index.js"
|
||||
],
|
||||
|
||||
"directories" : {
|
||||
"lib" : ".",
|
||||
"test" : "test"
|
||||
},
|
||||
|
||||
"bugs": {
|
||||
"url" : "http://github.com/stephenhandley/requireindex/issues"
|
||||
},
|
||||
|
||||
"engines" : {
|
||||
"node" : ">=0.10.5"
|
||||
},
|
||||
|
||||
"devDependencies": {
|
||||
"asserts": "4.0.x"
|
||||
},
|
||||
|
||||
"author": {
|
||||
"name": "Stephen Handley",
|
||||
"email": "stephen.handley@gmail.com",
|
||||
|
|
|
|||
3
node_modules/text-table/package.json
generated
vendored
3
node_modules/text-table/package.json
generated
vendored
|
|
@ -19,8 +19,7 @@
|
|||
"firefox/10..latest",
|
||||
"safari/latest",
|
||||
"opera/11.0..latest",
|
||||
"iphone/6",
|
||||
"ipad/6"
|
||||
"iphone/6", "ipad/6"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
|
|
|
|||
103
node_modules/type-detect/package.json
generated
vendored
103
node_modules/type-detect/package.json
generated
vendored
|
|
@ -1,102 +1 @@
|
|||
{
|
||||
"name": "type-detect",
|
||||
"description": "Improved typeof detection for node.js and the browser.",
|
||||
"keywords": [
|
||||
"type",
|
||||
"typeof",
|
||||
"types"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "Jake Luer <jake@alogicalparadox.com> (http://alogicalparadox.com)",
|
||||
"contributors": [
|
||||
"Keith Cirkel (https://github.com/keithamus)",
|
||||
"David Losert (https://github.com/davelosert)",
|
||||
"Aleksey Shvayka (https://github.com/shvaikalesh)",
|
||||
"Lucas Fernandes da Costa (https://github.com/lucasfcosta)",
|
||||
"Grant Snodgrass (https://github.com/meeber)",
|
||||
"Jeremy Tice (https://github.com/jetpacmonkey)",
|
||||
"Edward Betts (https://github.com/EdwardBetts)",
|
||||
"dvlsg (https://github.com/dvlsg)",
|
||||
"Amila Welihinda (https://github.com/amilajack)",
|
||||
"Jake Champion (https://github.com/JakeChampion)",
|
||||
"Miroslav Bajtoš (https://github.com/bajtos)"
|
||||
],
|
||||
"files": [
|
||||
"index.js",
|
||||
"type-detect.js"
|
||||
],
|
||||
"main": "./type-detect.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/chaijs/type-detect.git"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node bench",
|
||||
"build": "rollup -c rollup.conf.js",
|
||||
"commit-msg": "commitlint -x angular",
|
||||
"lint": "eslint --ignore-path .gitignore .",
|
||||
"prepare": "cross-env NODE_ENV=production npm run build",
|
||||
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
|
||||
"pretest:node": "cross-env NODE_ENV=test npm run build",
|
||||
"pretest:browser": "cross-env NODE_ENV=test npm run build",
|
||||
"test": "npm run test:node && npm run test:browser",
|
||||
"test:browser": "karma start --singleRun=true",
|
||||
"test:node": "nyc mocha type-detect.test.js",
|
||||
"posttest:node": "nyc report --report-dir \"coverage/node-$(node --version)\" --reporter=lcovonly && npm run upload-coverage",
|
||||
"posttest:browser": "npm run upload-coverage",
|
||||
"upload-coverage": "codecov"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"es6": true
|
||||
},
|
||||
"extends": [
|
||||
"strict/es6"
|
||||
],
|
||||
"globals": {
|
||||
"HTMLElement": false
|
||||
},
|
||||
"rules": {
|
||||
"complexity": 0,
|
||||
"max-statements": 0,
|
||||
"prefer-rest-params": 0
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^4.2.2",
|
||||
"benchmark": "^2.1.0",
|
||||
"buble": "^0.16.0",
|
||||
"codecov": "^3.0.0",
|
||||
"commitlint-config-angular": "^4.2.1",
|
||||
"cross-env": "^5.1.1",
|
||||
"eslint": "^4.10.0",
|
||||
"eslint-config-strict": "^14.0.0",
|
||||
"eslint-plugin-filenames": "^1.2.0",
|
||||
"husky": "^0.14.3",
|
||||
"karma": "^1.7.1",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-coverage": "^1.1.1",
|
||||
"karma-detect-browsers": "^2.2.5",
|
||||
"karma-edge-launcher": "^0.4.2",
|
||||
"karma-firefox-launcher": "^1.0.1",
|
||||
"karma-ie-launcher": "^1.0.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"karma-opera-launcher": "^1.0.0",
|
||||
"karma-safari-launcher": "^1.0.0",
|
||||
"karma-safaritechpreview-launcher": "0.0.6",
|
||||
"karma-sauce-launcher": "^1.2.0",
|
||||
"mocha": "^4.0.1",
|
||||
"nyc": "^11.3.0",
|
||||
"rollup": "^0.50.0",
|
||||
"rollup-plugin-buble": "^0.16.0",
|
||||
"rollup-plugin-commonjs": "^8.2.6",
|
||||
"rollup-plugin-istanbul": "^1.1.0",
|
||||
"rollup-plugin-node-resolve": "^3.0.0",
|
||||
"semantic-release": "^8.2.0",
|
||||
"simple-assert": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"version": "4.0.8"
|
||||
}
|
||||
{"name":"type-detect","description":"Improved typeof detection for node.js and the browser.","keywords":["type","typeof","types"],"license":"MIT","author":"Jake Luer <jake@alogicalparadox.com> (http://alogicalparadox.com)","contributors":["Keith Cirkel (https://github.com/keithamus)","David Losert (https://github.com/davelosert)","Aleksey Shvayka (https://github.com/shvaikalesh)","Lucas Fernandes da Costa (https://github.com/lucasfcosta)","Grant Snodgrass (https://github.com/meeber)","Jeremy Tice (https://github.com/jetpacmonkey)","Edward Betts (https://github.com/EdwardBetts)","dvlsg (https://github.com/dvlsg)","Amila Welihinda (https://github.com/amilajack)","Jake Champion (https://github.com/JakeChampion)","Miroslav Bajtoš (https://github.com/bajtos)"],"files":["index.js","type-detect.js"],"main":"./type-detect.js","repository":{"type":"git","url":"git+ssh://git@github.com/chaijs/type-detect.git"},"scripts":{"bench":"node bench","build":"rollup -c rollup.conf.js","commit-msg":"commitlint -x angular","lint":"eslint --ignore-path .gitignore .","prepare":"cross-env NODE_ENV=production npm run build","semantic-release":"semantic-release pre && npm publish && semantic-release post","pretest:node":"cross-env NODE_ENV=test npm run build","pretest:browser":"cross-env NODE_ENV=test npm run build","test":"npm run test:node && npm run test:browser","test:browser":"karma start --singleRun=true","test:node":"nyc mocha type-detect.test.js","posttest:node":"nyc report --report-dir \"coverage/node-$(node --version)\" --reporter=lcovonly && npm run upload-coverage","posttest:browser":"npm run upload-coverage","upload-coverage":"codecov"},"eslintConfig":{"env":{"es6":true},"extends":["strict/es6"],"globals":{"HTMLElement":false},"rules":{"complexity":0,"max-statements":0,"prefer-rest-params":0}},"devDependencies":{"@commitlint/cli":"^4.2.2","benchmark":"^2.1.0","buble":"^0.16.0","codecov":"^3.0.0","commitlint-config-angular":"^4.2.1","cross-env":"^5.1.1","eslint":"^4.10.0","eslint-config-strict":"^14.0.0","eslint-plugin-filenames":"^1.2.0","husky":"^0.14.3","karma":"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-detect-browsers":"^2.2.5","karma-edge-launcher":"^0.4.2","karma-firefox-launcher":"^1.0.1","karma-ie-launcher":"^1.0.0","karma-mocha":"^1.3.0","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-safaritechpreview-launcher":"0.0.6","karma-sauce-launcher":"^1.2.0","mocha":"^4.0.1","nyc":"^11.3.0","rollup":"^0.50.0","rollup-plugin-buble":"^0.16.0","rollup-plugin-commonjs":"^8.2.6","rollup-plugin-istanbul":"^1.1.0","rollup-plugin-node-resolve":"^3.0.0","semantic-release":"^8.2.0","simple-assert":"^1.0.0"},"engines":{"node":">=4"},"version":"4.0.8"}
|
||||
|
|
|
|||
4
node_modules/yaml/browser/dist/package.json
generated
vendored
4
node_modules/yaml/browser/dist/package.json
generated
vendored
|
|
@ -1,3 +1 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
{ "type": "module" }
|
||||
|
|
|
|||
4
node_modules/zlib/package.json
generated
vendored
4
node_modules/zlib/package.json
generated
vendored
|
|
@ -12,9 +12,7 @@
|
|||
"node": ">=0.2.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "BSD"
|
||||
}
|
||||
{ "type": "BSD" }
|
||||
],
|
||||
"main": "./lib/zlib"
|
||||
}
|
||||
|
|
|
|||
32
package-lock.json
generated
32
package-lock.json
generated
|
|
@ -29,6 +29,7 @@
|
|||
"del": "^6.1.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"file-url": "^3.0.0",
|
||||
"follow-redirects": "^1.15.9",
|
||||
"fs": "0.0.1-security",
|
||||
"get-folder-size": "^2.0.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
|
|
@ -48,6 +49,7 @@
|
|||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||
"@types/adm-zip": "^0.5.5",
|
||||
"@types/console-log-level": "^1.4.5",
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/get-folder-size": "^2.0.0",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "20.9.0",
|
||||
|
|
@ -1301,6 +1303,16 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/follow-redirects": {
|
||||
"version": "1.14.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/follow-redirects/-/follow-redirects-1.14.4.tgz",
|
||||
"integrity": "sha512-GWXfsD0Jc1RWiFmMuMFCpXMzi9L7oPDVwxUnZdg89kDNnqsRfUKXEtUYtA98A6lig1WXH/CYY/fvPW9HuN5fTA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/get-folder-size": {
|
||||
"version": "2.0.0",
|
||||
"dev": true,
|
||||
|
|
@ -4061,6 +4073,26 @@
|
|||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/for-each": {
|
||||
"version": "0.3.3",
|
||||
"dev": true,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
"del": "^6.1.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"file-url": "^3.0.0",
|
||||
"follow-redirects": "^1.15.9",
|
||||
"fs": "0.0.1-security",
|
||||
"get-folder-size": "^2.0.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
|
|
@ -64,6 +65,7 @@
|
|||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||
"@types/adm-zip": "^0.5.5",
|
||||
"@types/console-log-level": "^1.4.5",
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/get-folder-size": "^2.0.0",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "20.9.0",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { IncomingMessage, OutgoingHttpHeaders } from "http";
|
||||
import * as https from "https";
|
||||
import * as path from "path";
|
||||
import { performance } from "perf_hooks";
|
||||
|
||||
import * as toolcache from "@actions/tool-cache";
|
||||
import { https } from "follow-redirects";
|
||||
import { v4 as uuidV4 } from "uuid";
|
||||
|
||||
import { Feature, FeatureEnablement } from "./feature-flags";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue