mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
fix etag quotes for avatars
This commit is contained in:
parent
5bc1831644
commit
e7cec3556a
@ -43,7 +43,7 @@ router.get("/:uuid.:ext?", function(req, res) {
|
|||||||
logging.error(err);
|
logging.error(err);
|
||||||
}
|
}
|
||||||
etag = hash && hash.substr(0, 32) || "none";
|
etag = hash && hash.substr(0, 32) || "none";
|
||||||
var matches = req.get("If-None-Match") == "'" + etag + "'";
|
var matches = req.get("If-None-Match") == '"' + etag + '"';
|
||||||
if (image) {
|
if (image) {
|
||||||
var http_status = 200;
|
var http_status = 200;
|
||||||
if (matches) {
|
if (matches) {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ router.get("/:uuid.:ext?", function(req, res) {
|
|||||||
logging.error(err);
|
logging.error(err);
|
||||||
}
|
}
|
||||||
etag = hash && hash.substr(0, 32) || "none";
|
etag = hash && hash.substr(0, 32) || "none";
|
||||||
var matches = req.get("If-None-Match") == "\"" + etag + "\"";
|
var matches = req.get("If-None-Match") == '"' + etag + '"';
|
||||||
if (image) {
|
if (image) {
|
||||||
var http_status = 200;
|
var http_status = 200;
|
||||||
if (matches) {
|
if (matches) {
|
||||||
@ -77,7 +77,7 @@ router.get("/:uuid.:ext?", function(req, res) {
|
|||||||
"Response-Time": new Date() - start,
|
"Response-Time": new Date() - start,
|
||||||
"X-Storage-Type": "downloaded",
|
"X-Storage-Type": "downloaded",
|
||||||
"Access-Control-Allow-Origin": "*",
|
"Access-Control-Allow-Origin": "*",
|
||||||
"Etag": "\"" + etag + "\""
|
"Etag": '"' + etag + '"'
|
||||||
});
|
});
|
||||||
res.end(http_status == 304 ? null : image);
|
res.end(http_status == 304 ? null : image);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user