follow-redirects
Advanced tools
Comparing version 1.15.8 to 1.15.9
31
index.js
@@ -8,4 +8,14 @@ var url = require("url"); | ||
var debug = require("./debug"); | ||
var nope = require("./nope"); | ||
// 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 | ||
@@ -351,6 +361,6 @@ var useNativeURL = false; | ||
// Only write if this request has not been redirected yet | ||
/* istanbul ignore else */ | ||
// istanbul ignore else | ||
if (request === self._currentRequest) { | ||
// Report any write errors | ||
/* istanbul ignore if */ | ||
// istanbul ignore if | ||
if (error) { | ||
@@ -362,3 +372,3 @@ self.emit("error", error); | ||
var buffer = buffers[i++]; | ||
/* istanbul ignore else */ | ||
// istanbul ignore else | ||
if (!request.finished) { | ||
@@ -491,3 +501,3 @@ request.write(buffer.data, buffer.encoding, writeNext); | ||
// Wraps the key/value object of protocols with redirect functionality | ||
var wrap = nope.wrap || function wrap(protocols) { | ||
function wrap(protocols) { | ||
// Default settings | ||
@@ -554,3 +564,3 @@ var exports = { | ||
return exports; | ||
}; | ||
} | ||
@@ -561,3 +571,3 @@ function noop() { /* empty */ } | ||
var parsed; | ||
/* istanbul ignore else */ | ||
// istanbul ignore else | ||
if (useNativeURL) { | ||
@@ -577,3 +587,3 @@ parsed = new URL(input); | ||
function resolveUrl(relative, base) { | ||
/* istanbul ignore next */ | ||
// istanbul ignore next | ||
return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); | ||
@@ -627,3 +637,6 @@ } | ||
function CustomError(properties) { | ||
Error.captureStackTrace(this, this.constructor); | ||
// istanbul ignore else | ||
if (isFunction(Error.captureStackTrace)) { | ||
Error.captureStackTrace(this, this.constructor); | ||
} | ||
Object.assign(this, properties || {}); | ||
@@ -630,0 +643,0 @@ this.code = code; |
{ | ||
"name": "follow-redirects", | ||
"version": "1.15.8", | ||
"version": "1.15.9", | ||
"description": "HTTP and HTTPS modules that follow redirects.", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"browser": "nope.js", | ||
"files": [ | ||
@@ -20,3 +19,3 @@ "*.js" | ||
"type": "git", | ||
"url": "git@github.com:follow-redirects/follow-redirects.git" | ||
"url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git" | ||
}, | ||
@@ -23,0 +22,0 @@ "homepage": "https://github.com/follow-redirects/follow-redirects", |
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
0
2
29918
7
625