Skip to content

Commit

Permalink
fix no cache condition
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Nov 15, 2018
1 parent 131bbbb commit 1d87543
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apikeys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports.init = function(config, logger, stats) {
}

var exchangeApiKeyForToken = function(req, res, next, config, logger, stats, middleware, apiKey) {
var cacheControl = req.headers["cache-control"];
var cacheControl = req.headers["cache-control"] || 'no-control';
if (cacheKey || (cacheControl && cacheControl.indexOf("no-cache") < 0)) { // caching is allowed
cache.read(apiKey, function(err, value) {
if (value) {
Expand Down
4 changes: 2 additions & 2 deletions oauth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ module.exports.init = function(config, logger, stats) {
}

var exchangeApiKeyForToken = function(req, res, next, config, logger, stats, middleware, apiKey) {
var cacheControl = req.headers['cache-control'];
var cacheControl = req.headers['cache-control'] || 'no-cache';
if (cacheKey || (!cacheControl || (cacheControl && cacheControl.indexOf('no-cache') < 0))) { // caching is allowed
cache.read(apiKey, function(err, value) {
if (value) {
Expand Down Expand Up @@ -445,4 +445,4 @@ function sendError(req, res, next, logger, stats, code, message) {
stats.incrementStatusCount(res.statusCode);
next(code, message);
return code;
}
}

0 comments on commit 1d87543

Please sign in to comment.