From 0dfc91f9483b0cee6f83bf4868eb0029e68b7748 Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 4 Jan 2015 04:32:59 +0100 Subject: [PATCH] don't send etag on error, improves #48 --- routes/avatars.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/avatars.js b/routes/avatars.js index 1257886..3f54501 100644 --- a/routes/avatars.js +++ b/routes/avatars.js @@ -49,7 +49,7 @@ module.exports = function(req, res) { if (err) { logging.error(uuid + " " + err); } - etag = hash && hash.substr(0, 32) || "none"; + etag = !err && hash && hash.substr(0, 32) || "none"; var matches = req.headers["if-none-match"] == '"' + etag + '"'; if (image) { var http_status = 200;