Skip to content

Commit

Permalink
fix for b132970272
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed May 17, 2019
1 parent 05eb180 commit 77530a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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"] || 'no-control';
var cacheControl = req.headers["cache-control"] || 'no-cache';
if (cacheKey || (cacheControl && cacheControl.indexOf("no-cache") < 0)) { // caching is allowed
cache.read(apiKey, function(err, value) {
if (value) {
Expand Down Expand Up @@ -193,7 +193,7 @@ module.exports.init = function(config, logger, stats) {
req.headers["x-authorization-claims"] = new Buffer(JSON.stringify(authClaims)).toString("base64");

if (apiKey) {
var cacheControl = req.headers["cache-control"];
var cacheControl = req.headers["cache-control"] || "no-cache";
if (cacheKey || (cacheControl && cacheControl.indexOf("no-cache") < 0)) { // caching is toFixed
// default to now (in seconds) + 30m if not set
decodedToken.exp = decodedToken.exp || +(((Date.now() / 1000) + 1800).toFixed(0));
Expand Down

0 comments on commit 77530a3

Please sign in to comment.