Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

foxy

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

foxy - npm Package Compare versions

Comparing version 7.1.0 to 8.0.0

6

index.js

@@ -59,5 +59,3 @@ /**

use: function (path, fn) {
if (!config.get("staticFiles").has(path)) {
config = config.setIn(["staticFiles", path], fn);
}
config = config.set("middleware", config.get("middleware").push({path: path, fn: fn}));
}

@@ -69,4 +67,4 @@ };

module.exports = foxy;
module.exports = foxy;
module.exports.init = foxy; // backwards compatibility

@@ -25,3 +25,7 @@ var Immutable = require("immutable");

*/
staticFiles: {}
staticFiles: {},
/**
*
*/
middleware: []
});

@@ -56,4 +60,16 @@

var mw = item.get("middleware");
if (typeof mw === "function") {
item.set("middleware", Immutable.List([{fn: mw}]));
} else {
if (Immutable.List.isList(mw)) {
item.set("middleware", mw.map(function (mwitem) {
return {fn: mwitem};
}));
}
}
return item;
});
};

@@ -1,3 +0,3 @@

var respMod = require("resp-modifier");
var utils = require("./utils");
var respMod = require("resp-modifier");
var utils = require("./utils");

@@ -7,3 +7,3 @@ /**

* @param proxyServer
* @param config
* @param userConfig
* @returns {Function}

@@ -36,13 +36,26 @@ */

if (config.get("staticFiles").has(req.url)) {
return config.getIn(["staticFiles", req.url])(req, res);
}
if (config.has("middleware")) {
config.get("middleware")(req, res, function (skip) {
if (skip) {
return;
if (config.get("middleware").size) {
var mw = config.get("middleware");
var size = mw.size;
var count = 0;
mw.forEach(function (item) {
if (item.path) {
if (req.url === item.path) {
item.fn(req, res, function () {
if (count === (size - 1)) {
utils.handleIe(req);
return middleware(req, res, next);
}
count += 1;
});
}
} else {
item.fn(req, res, function () {
if (count === (size - 1)) {
utils.handleIe(req);
return middleware(req, res, next);
}
count += 1;
});
}
utils.handleIe(req);
middleware(req, res, next);
});

@@ -49,0 +62,0 @@ } else {

{
"name": "foxy",
"version": "7.1.0",
"version": "8.0.0",
"description": "Proxy with response modding",

@@ -5,0 +5,0 @@ "main": "index.js",

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