Comparing version 4.0.3 to 4.0.4
@@ -36,3 +36,11 @@ "use strict"; | ||
function getDefaultWindowLocation() { | ||
return { host: "localhost", protocol: "http" }; | ||
var winloc = { | ||
hostname: "localhost", | ||
port: process.env.PORT || 80, | ||
protocol: "http:" | ||
}; | ||
winloc.host = | ||
winloc.hostname + | ||
(String(winloc.port) === "80" ? "" : ":" + winloc.port); | ||
return winloc; | ||
} | ||
@@ -77,3 +85,3 @@ | ||
var rCurrLoc = new RegExp("^" + wloc.protocol + "//" + wloc.host); | ||
var rCurrLoc = new RegExp("^" + wloc.protocol + "//" + wloc.host + "/"); | ||
@@ -83,3 +91,3 @@ var requestUrl = request.url; | ||
if (!/^https?:\/\//.test(requestUrl) || rCurrLoc.test(requestUrl)) { | ||
requestUrl = requestUrl.replace(rCurrLoc, ""); | ||
requestUrl = requestUrl.replace(rCurrLoc, "/"); | ||
} | ||
@@ -234,2 +242,9 @@ | ||
// Escape port number to prevent "named" parameters in 'path-to-regexp' module | ||
if (typeof url === "string" && url !== "" && /:[0-9]+\//.test(url)) { | ||
var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/); | ||
// eslint-disable-next-line no-param-reassign | ||
url = m[1] + "\\:" + m[2]; | ||
} | ||
push.call(this.responses, { | ||
@@ -236,0 +251,0 @@ method: method, |
{ | ||
"name": "nise", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "Fake XHR and server", | ||
@@ -46,3 +46,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@sinonjs/referee": "^4.0.0", | ||
"@sinonjs/referee": "^5.0.0", | ||
"browserify": "^16.2.3", | ||
@@ -56,3 +56,3 @@ "eslint": "^6.1.0", | ||
"husky": "^4.2.1", | ||
"jsdom": "^15.1.1", | ||
"jsdom": "^16.2.0", | ||
"jsdom-global": "3.0.2", | ||
@@ -59,0 +59,0 @@ "mocha": "^7.0.1", |
Sorry, the diff of this file is too big to display
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
845042
10493
5