follow-redirects
Advanced tools
Comparing version 1.15.7 to 1.15.8
13
index.js
@@ -10,13 +10,6 @@ var url = require("url"); | ||
// Disaster prevention | ||
/* istanbul ignore next */ | ||
if (nope.isBrowser()) { | ||
module.exports = nope; | ||
return; | ||
} | ||
// Whether to use the native URL object or the legacy url module | ||
var useNativeURL = false; | ||
try { | ||
assert(new URL()); | ||
assert(new URL("")); | ||
} | ||
@@ -496,3 +489,3 @@ catch (error) { | ||
// Wraps the key/value object of protocols with redirect functionality | ||
function wrap(protocols) { | ||
var wrap = nope.wrap || function wrap(protocols) { | ||
// Default settings | ||
@@ -559,3 +552,3 @@ var exports = { | ||
return exports; | ||
} | ||
}; | ||
@@ -562,0 +555,0 @@ function noop() { /* empty */ } |
17
nope.js
// follow-redirects absolutely must not be used in the browser. | ||
// Neither should the `http` and `http` modules it replaces, yet here we are. | ||
// Neither should the `http` and `https` modules it replaces, yet here we are. | ||
var http = require("http"); | ||
var https = require("https"); | ||
/* istanbul ignore next */ // eslint-disable-next-line no-undef | ||
// eslint-disable-next-line no-undef | ||
var browser = typeof window !== "undefined" && typeof window.document !== "undefined"; | ||
@@ -12,10 +12,9 @@ | ||
https: https, | ||
wrap: function () { | ||
// Honestly looking forward to this bug report | ||
throw new Error("Best viewed in Internet Explorer"); | ||
wrap: browser && function (module) { | ||
// eslint-disable-next-line | ||
console.warn("Exclude follow-redirects from browser builds."); | ||
return module; | ||
}, | ||
isBrowser() { | ||
/* istanbul ignore next */ // eslint-disable-next-line | ||
return browser && !!console.warn("Exclude follow-redirects from browser builds."); | ||
}, | ||
}; | ||
/* istanbul ignore file */ |
{ | ||
"name": "follow-redirects", | ||
"version": "1.15.7", | ||
"version": "1.15.8", | ||
"description": "HTTP and HTTPS modules that follow redirects.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
30023
629