Socket
Socket
Sign inDemoInstall

protein

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.2 to 0.3.3

8

index.js

@@ -54,4 +54,6 @@ var http = require('http');

if (route) {
if (req.url.substr(0, route.length) !== route) return loop(err);
req.url = req.url.substr(route.length-1);
if (url.substr(0, route.length) !== route) return loop(err);
req.url = url.substr(route.length) || '/';
if (req.url[0] === '?') req.url = '/'+req.url;
if (req.url[0] !== '/') return loop(err);
}

@@ -98,3 +100,3 @@ try {

if (typeof fn === 'function') {
fn.route = route && route.replace(/\/$/, '')+'/';
fn.route = route && route.replace(/\/$/, '');
stack.push(fn);

@@ -101,0 +103,0 @@ }

{
"name":"protein",
"version":"0.3.2",
"version":"0.3.3",
"repository": "git://github.com/mafintosh/protein",

@@ -5,0 +5,0 @@ "description":"Protein is connect compatible middleware with support for prototype methods, getters, and setters",

@@ -45,2 +45,6 @@ var protein = require('../index');

})
.use('/myurl/more', function(req, res, next) {
assert.equal(req.url, '/');
next();
})
.use(function(req, res) {

@@ -47,0 +51,0 @@ complete = true;

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc