Explorar o código

actually do send etag on error, but send "none" etag when no (=default) image is sent

jomo %!s(int64=10) %!d(string=hai) anos
pai
achega
a9a0032b1f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      routes/avatars.js

+ 1 - 1
routes/avatars.js

@@ -49,7 +49,7 @@ module.exports = function(req, res) {
       if (err) {
         logging.error(uuid + " " + err);
       }
-      etag = !err && hash && hash.substr(0, 32) || "none";
+      etag = image && hash && hash.substr(0, 32) || "none";
       var matches = req.headers["if-none-match"] == '"' + etag + '"';
       if (image) {
         var http_status = 200;