Showing
1 changed file
with
2 additions
and
1 deletions
@@ -84,8 +84,9 @@ const handlerError = (err = {}, req, res, next) => { | @@ -84,8 +84,9 @@ const handlerError = (err = {}, req, res, next) => { | ||
84 | }; | 84 | }; |
85 | 85 | ||
86 | const getCacheKey = (req, cacheKey = '') => { | 86 | const getCacheKey = (req, cacheKey = '') => { |
87 | + const isYohoProtocol = _.get(req.app.locals.wap, `webapp.${config.appName}-yoho-protocol`, false); | ||
87 | const urlObj = url.parse(req.url); | 88 | const urlObj = url.parse(req.url); |
88 | - const yohoProtocol = req.get('User-Agent').indexOf('yoho-protocol') >= 0 ? 'yoho-protocol' : ''; | 89 | + const yohoProtocol = (req.get('User-Agent').indexOf('yoho-protocol') >= 0 && isYohoProtocol) ? 'yoho-protocol' : ''; |
89 | 90 | ||
90 | return md5(cacheKey | 91 | return md5(cacheKey |
91 | .replace('$url', urlObj.pathname) | 92 | .replace('$url', urlObj.pathname) |
-
Please register or login to post a comment