Comparing version 0.0.7 to 0.0.8
@@ -8,2 +8,6 @@ var Options = require('options') | ||
RegExp.quote = function(str) { | ||
return (str+'').replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&"); | ||
}; | ||
module.exports = SSE; | ||
@@ -24,3 +28,3 @@ module.exports.Client = SSEClient; | ||
var pathname = u.pathname.replace(/^\/{2,}/, '/'); | ||
if (pathname == options.value.path && (options.value.verifyRequest == null || options.value.verifyRequest(req))) { | ||
if (self.matchesPath(pathname, options.value.path) && (options.value.verifyRequest == null || options.value.verifyRequest(req))) { | ||
self.handleRequest(req, res, u.query); | ||
@@ -43,1 +47,6 @@ } | ||
} | ||
SSE.prototype.matchesPath = function(queryPath, matchPath) { | ||
var match = RegExp.quote(matchPath).replace('\\*', '.*'); | ||
return RegExp('^' + match + '$').test(queryPath); | ||
} |
{ | ||
"author": "Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)", | ||
"name": "sse", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "real-time", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7501
112
0