summaryrefslogtreecommitdiff
path: root/src/node/utils
diff options
context:
space:
mode:
authorChad Weider <cweider@oofn.net>2012-03-04 15:04:54 -0800
committerChad Weider <cweider@oofn.net>2012-03-10 15:27:17 -0800
commitc0fc7f9b0c58fa3caf3cd49b83fe477a98e020c3 (patch)
treec20d249238f1e0923c7eb8ade2c1e2e3da47f9fe /src/node/utils
parentca91c0c4032658d428fadbb8f178fb52be3ac471 (diff)
downloadetherpad-lite-c0fc7f9b0c58fa3caf3cd49b83fe477a98e020c3.zip
Avoid orphaned cache files from breaking the caching layer.
(cherry picked from commit 57d0a2e803d8efd2721c575e225bc9d90910d6d3)
Diffstat (limited to 'src/node/utils')
-rw-r--r--src/node/utils/caching_middleware.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node/utils/caching_middleware.js b/src/node/utils/caching_middleware.js
index 29c95049..9e62ee84 100644
--- a/src/node/utils/caching_middleware.js
+++ b/src/node/utils/caching_middleware.js
@@ -55,7 +55,7 @@ CachingMiddleware.prototype = new function () {
var modifiedSince = (req.headers['if-modified-since']
&& new Date(req.headers['if-modified-since']));
var lastModifiedCache = !error && stats.mtime;
- if (lastModifiedCache) {
+ if (lastModifiedCache && responseCache[cacheKey]) {
req.headers['if-modified-since'] = lastModifiedCache.toUTCString();
} else {
delete req.headers['if-modified-since'];