New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mixdown-router

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixdown-router - npm Package Compare versions

Comparing version 4.1.2 to 4.1.3

26

lib/controller.js

@@ -54,16 +54,16 @@ var _ = require('lodash');

Controller.prototype.parse = function (httpContext) {
Controller.prototype.parse_url = function (url_object) {
var params = {};
// LOAD httpContext.params
// validate and attach blessed query params. Non-declared will still exist on httpContext.url.
// validate and attach blessed query params. Non-declared will still exist on url_object.
_.each(this.queryParams, function (p, name) {
if (typeof (httpContext.url.query[name]) !== 'undefined' && p.regex.test(httpContext.url.query[name])) {
httpContext.params[name] = httpContext.url.query[name];
if (typeof (url_object.query[name]) !== 'undefined' && p.regex.test(url_object.query[name])) {
params[name] = url_object.query[name];
} else if (p['default']) {
httpContext.params[name] = p['default'];
params[name] = p['default'];
}
});
var urlParams = httpContext.url.pathname.split('/');
var urlParams = url_object.pathname.split('/');

@@ -80,3 +80,3 @@ if (urlParams[0] === "") {

if (m) {
httpContext.params[pmap.name] = decodeURIComponent(_.last(m));
params[pmap.name] = decodeURIComponent(_.last(m));
}

@@ -87,2 +87,10 @@ }

// return context.
return params;
};
Controller.prototype.parse = function (httpContext) {
// return context.
httpContext.params = this.parse_url(httpContext.url);
return httpContext;

@@ -126,2 +134,2 @@ };

module.exports = Controller;
module.exports = Controller;

@@ -32,3 +32,3 @@ var _ = require('lodash');

restParams[i] = _.clone(param);
restParams[i].regex = new RegExp(rstr);
restParams[i].regex = param.regex instanceof RegExp ? param.regex : new RegExp(rstr);
} else {

@@ -49,2 +49,2 @@ urlformat.push(str);

};
};
};
{
"name": "mixdown-router",
"version": "4.1.2",
"version": "4.1.3",
"description": "Router for mixdown.js",

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