express-perf
Advanced tools
Comparing version 1.10.0 to 1.10.1
17
index.js
@@ -15,3 +15,3 @@ var https = require('https') | ||
layer = this.stack[offset] | ||
if (layer && layer.regexp && !layer.regexp.fast_slash && fn !== '*') { | ||
if (layer && fn !== '/' && (layer.regexp && !layer.regexp.fast_slash)) { | ||
layer.__basePath = fn | ||
@@ -31,4 +31,7 @@ } | ||
express.Router.process_params = function (layer, called, req, res, done) { | ||
if (layer.__basePath) { | ||
req.__baseRoute = (req.__baseRoute || '') + layer.__basePath | ||
// this identifies if we're using express.Router() | ||
// based methods | ||
if (typeof layer.handle.stack === 'object' && layer.__basePath) { | ||
req.__routeStack = (req.__routeStack || []) | ||
req.__routeStack.push(layer.__basePath) | ||
} | ||
@@ -115,3 +118,9 @@ | ||
var uri = (req.__baseRoute || "") + (req.__layerPath || "") | ||
var uri = ""; | ||
if (req.__routeStack) { | ||
uri = uri + req.__routeStack.join("") | ||
} | ||
if (req.__layerPath) { | ||
uri = uri + req.__layerPath | ||
} | ||
if (uri[uri.length - 1] === "/") { | ||
@@ -118,0 +127,0 @@ uri = uri.substring(0, uri.length - 1) |
{ | ||
"name": "express-perf", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha" | ||
}, | ||
@@ -18,3 +18,8 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/perflabs/nodejs#readme" | ||
"homepage": "https://github.com/perflabs/nodejs#readme", | ||
"devDependencies": { | ||
"express": "^4.14.0", | ||
"mocha": "^3.1.2", | ||
"supertest": "^2.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
40489
131
1
3