find-my-way
Advanced tools
Comparing version 1.17.0 to 1.17.1
10
index.js
@@ -21,3 +21,8 @@ 'use strict' | ||
const httpMethods = http.METHODS | ||
const FULL_PATH_REGEXP = /^https?:\/\/.*\// | ||
if (!isRegexSafe(FULL_PATH_REGEXP)) { | ||
throw new Error('the FULL_PATH_REGEXP is not safe, update this module') | ||
} | ||
function Router (opts) { | ||
@@ -333,2 +338,7 @@ if (!(this instanceof Router)) { | ||
} | ||
if (path.charCodeAt(0) !== 47) { // 47 is '/' | ||
path = path.replace(FULL_PATH_REGEXP, '/') | ||
} | ||
var maxParamLength = this.maxParamLength | ||
@@ -335,0 +345,0 @@ var currentNode = this.tree |
{ | ||
"name": "find-my-way", | ||
"version": "1.17.0", | ||
"version": "1.17.1", | ||
"description": "Crazy fast http radix based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -103,3 +103,2 @@ 'use strict' | ||
findMyWay.on('GET', '/Foo/bar/:param', (req, res, params) => { | ||
console.log('baz') | ||
t.equal(params.param, 'baz') | ||
@@ -126,3 +125,2 @@ }) | ||
findMyWay.on('GET', '/Foo/bar/:param', (req, res, params) => { | ||
console.log('baz') | ||
t.equal(params.param, 'baz') | ||
@@ -132,3 +130,2 @@ }) | ||
findMyWay.on('GET', '/Foo/baz/:param', (req, res, params) => { | ||
console.log('bar') | ||
t.equal(params.param, 'bar') | ||
@@ -135,0 +132,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148840
37
4261