diff --git a/lib/Controller.js b/lib/Controller.js index 330e451..8c6e49c 100644 --- a/lib/Controller.js +++ b/lib/Controller.js @@ -90,6 +90,16 @@ Controller.prototype.checkRoute = function(req, urlParts) { break; + case "#": //IP + var replaced = urlPart.replace(/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/g, ""); + + if(replaced.length === 0) { + params[routePart.substr(1)] = urlPart; + } else { + cont = true; + } + break; + case "[": //Probably regexp. Need to check for outer bracket if(routePart.lastIndexOf("]") !== -1) { var reg = new RegExp(routePart.substr(routePart.indexOf("[") + 1, routePart.lastIndexOf("]") - 1));