Comparing version 3.7.0 to 3.7.1
@@ -5,2 +5,4 @@ const {URL} = require('url') | ||
const unspecifiedFollowRedirectsDefault = 20 | ||
/** | ||
@@ -53,2 +55,10 @@ * phin options object. phin also supports all options from <a href="https://nodejs.org/api/http.html#http_http_request_options_callback">http.request(options, callback)</a> by passing them on to this method (or similar). | ||
if (opts.followRedirects) { | ||
if (opts.followRedirects === true) { | ||
req.followRedirects(unspecifiedFollowRedirectsDefault) | ||
} else if (typeof opts.followRedirects === 'number') { | ||
req.followRedirects(opts.followRedirects) | ||
} | ||
} | ||
if (typeof opts.core === 'object') { | ||
@@ -62,8 +72,2 @@ Object.keys(opts.core).forEach((optName) => { | ||
if (res.headers.hasOwnProperty('location') && opts.followRedirects) { | ||
opts.url = (new URL(res.headers['location'], opts.url)).toString() | ||
return await phin(opts) | ||
} | ||
if (opts.stream) { | ||
@@ -70,0 +74,0 @@ res.stream = res |
{ | ||
"name": "phin", | ||
"version": "3.7.0", | ||
"version": "3.7.1", | ||
"description": "The ultra-lightweight Node.js HTTP client", | ||
@@ -9,4 +9,3 @@ "main": "lib/phin.js", | ||
"test": "node ./tests/test.js", | ||
"prepublishOnly": "npm test", | ||
"gendocs": "rm -r docs || true && jsdoc -R README.md -d ./docs lib/phin.js" | ||
"prepublishOnly": "npm test" | ||
}, | ||
@@ -32,6 +31,2 @@ "repository": { | ||
"homepage": "https://github.com/ethanent/phin", | ||
"devDependencies": { | ||
"jsdoc": "^3.5.5", | ||
"whew": "^1.1.3" | ||
}, | ||
"files": [ | ||
@@ -45,4 +40,4 @@ "lib/phin.js", | ||
"dependencies": { | ||
"centra": "^2.6.0" | ||
"centra": "^2.7.0" | ||
} | ||
} |
@@ -9,3 +9,6 @@ <p align="center" style="text-align: center"><img src="https://raw.githubusercontent.com/ethanent/phin/master/media/phin-textIncluded.png" width="250" alt="phin logo"/></p> | ||
## Deprecated | ||
This package is deprecated and should not be used. Please see [#91](https://github.com/ethanent/phin/issues/91) for more information. | ||
## Simple Usage | ||
@@ -12,0 +15,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
13169
0
197
0
130
Updatedcentra@^2.7.0