From 6dff8add964214ea87818f8a375b6a5ea27438d2 Mon Sep 17 00:00:00 2001 From: zazeblik Date: Thu, 30 Aug 2018 11:46:04 +0300 Subject: [PATCH] Update cache.js --- cache.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cache.js b/cache.js index fdbc280..0cdc905 100755 --- a/cache.js +++ b/cache.js @@ -51,7 +51,7 @@ function Cache() { let selfCache = this; this.set = function (key, ttl, result) { - key = key.replace("+",""); + //key = key.replace("+",""); if (this.cache && this.cache[key] && this.cache[key]._timeOut) clearTimeout(this.cache[key]._timeOut); @@ -74,7 +74,7 @@ function Cache() { this.set = this.set.bind(caching.store); this.get = function(pattern, callback) { - pattern = pattern.replace("+",""); + pattern = pattern.replace("+","\\+"); let self = this; if (~pattern.indexOf('*')) { pattern = new RegExp(pattern.replace(/\*/g, '.*'), 'g'); @@ -122,4 +122,4 @@ function Cache() { this.get = this.get.bind(caching.store); }; -module.exports = Cache; \ No newline at end of file +module.exports = Cache;