Socket
Socket
Sign inDemoInstall

nise

Package Overview
Dependencies
Maintainers
4
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nise - npm Package Compare versions

Comparing version 4.0.3 to 4.0.4

21

lib/fake-server/index.js

@@ -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,

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc