chore:更换到主分支

This commit is contained in:
张益铭
2021-03-01 15:26:05 +08:00
parent 9064b372e8
commit 6a5f1810f9
3530 changed files with 59613 additions and 479452 deletions

View File

@@ -3,7 +3,7 @@
Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects.
[![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects)
[![Build Status](https://travis-ci.org/follow-redirects/follow-redirects.svg?branch=master)](https://travis-ci.org/follow-redirects/follow-redirects)
[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions)
[![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master)
[![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects)
[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh)

View File

@@ -1,9 +1,14 @@
var debug;
try {
/* eslint global-require: off */
debug = require("debug")("follow-redirects");
}
catch (error) {
debug = function () { /* */ };
}
module.exports = debug;
module.exports = function () {
if (!debug) {
try {
/* eslint global-require: off */
debug = require("debug")("follow-redirects");
}
catch (error) {
debug = function () { /* */ };
}
}
debug.apply(null, arguments);
};

View File

@@ -400,7 +400,7 @@ function wrap(protocols) {
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
// Executes a request, following redirects
wrappedProtocol.request = function (input, options, callback) {
function request(input, options, callback) {
// Parse parameters
if (typeof input === "string") {
var urlStr = input;
@@ -435,14 +435,20 @@ function wrap(protocols) {
assert.equal(options.protocol, protocol, "protocol mismatch");
debug("options", options);
return new RedirectableRequest(options, callback);
};
}
// Executes a GET request, following redirects
wrappedProtocol.get = function (input, options, callback) {
var request = wrappedProtocol.request(input, options, callback);
request.end();
return request;
};
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;
}

View File

@@ -1,32 +1,31 @@
{
"_args": [
[
"follow-redirects@1.13.0",
"follow-redirects@1.13.2",
"J:\\Github\\CURD-TS"
]
],
"_development": true,
"_from": "follow-redirects@1.13.0",
"_id": "follow-redirects@1.13.0",
"_from": "follow-redirects@1.13.2",
"_id": "follow-redirects@1.13.2",
"_inBundle": false,
"_integrity": "sha1-tC6Nk6Kn7qXtiGM2dtZZe8jjhNs=",
"_integrity": "sha1-3XPI7/wScoulz0JZ12DqX7g+MUc=",
"_location": "/follow-redirects",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "follow-redirects@1.13.0",
"raw": "follow-redirects@1.13.2",
"name": "follow-redirects",
"escapedName": "follow-redirects",
"rawSpec": "1.13.0",
"rawSpec": "1.13.2",
"saveSpec": null,
"fetchSpec": "1.13.0"
"fetchSpec": "1.13.2"
},
"_requiredBy": [
"/http-proxy"
"/axios"
],
"_resolved": "http://192.168.250.101:4873/follow-redirects/-/follow-redirects-1.13.0.tgz",
"_spec": "1.13.0",
"_resolved": "http://192.168.250.101:4873/follow-redirects/-/follow-redirects-1.13.2.tgz",
"_spec": "1.13.2",
"_where": "J:\\Github\\CURD-TS",
"author": {
"name": "Ruben Verborgh",
@@ -81,6 +80,11 @@
"license": "MIT",
"main": "index.js",
"name": "follow-redirects",
"peerDependenciesMeta": {
"debug": {
"optional": true
}
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git"
@@ -90,5 +94,5 @@
"mocha": "nyc mocha",
"test": "npm run lint && npm run mocha"
},
"version": "1.13.0"
"version": "1.13.2"
}