find-my-way
Advanced tools
Comparing version 0.2.3 to 0.2.4
14
index.js
@@ -135,5 +135,3 @@ 'use strict' | ||
Router.prototype.lookup = function (req, res) { | ||
var i = 0 | ||
while (i < req.url.length && req.url.charCodeAt(i) !== 63 /* ? */ && req.url.charCodeAt(i) !== 35 /* # */) i++ | ||
var handle = this.find(req.method, req.url.slice(0, i)) | ||
var handle = this.find(req.method, sanitizeUrl(req.url)) | ||
if (!handle) return this._defaultRoute(req, res) | ||
@@ -235,1 +233,11 @@ return handle.handler(req, res, handle.params, handle.store) | ||
module.exports = Router | ||
function sanitizeUrl (url) { | ||
for (var i = 0; i < url.length; i++) { | ||
var charCode = url.charCodeAt(i) | ||
if (charCode === 63 /* ? */ || charCode === 35 /* # */) { | ||
return url.slice(0, i) | ||
} | ||
} | ||
return url | ||
} |
{ | ||
"name": "find-my-way", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Crazy fast http radix based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
27930
737