mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
convert keys to lower case at cache level
This commit is contained in:
parent
c8d28ed2df
commit
9faeedc03f
@ -59,6 +59,8 @@ exp.get_redis = function() {
|
|||||||
exp.update_timestamp = function(uuid, hash) {
|
exp.update_timestamp = function(uuid, hash) {
|
||||||
logging.log(uuid + " cache: updating timestamp");
|
logging.log(uuid + " cache: updating timestamp");
|
||||||
var time = new Date().getTime();
|
var time = new Date().getTime();
|
||||||
|
// store uuid in lower case if not null
|
||||||
|
uuid = uuid && uuid.toLowerCase();
|
||||||
redis.hmset(uuid, "t", time);
|
redis.hmset(uuid, "t", time);
|
||||||
update_file_date(hash);
|
update_file_date(hash);
|
||||||
};
|
};
|
||||||
@ -78,6 +80,8 @@ exp.save_hash = function(uuid, hash) {
|
|||||||
// {hash: "0123456789abcdef", time: 1414881524512}
|
// {hash: "0123456789abcdef", time: 1414881524512}
|
||||||
// null when uuid unkown
|
// null when uuid unkown
|
||||||
exp.get_details = function(uuid, callback) {
|
exp.get_details = function(uuid, callback) {
|
||||||
|
// get uuid in lower case if not null
|
||||||
|
uuid = uuid && uuid.toLowerCase();
|
||||||
redis.hgetall(uuid, function(err, data) {
|
redis.hgetall(uuid, function(err, data) {
|
||||||
var details = null;
|
var details = null;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|||||||
@ -15,7 +15,7 @@ var human_status = {
|
|||||||
|
|
||||||
/* GET avatar request. */
|
/* GET avatar request. */
|
||||||
router.get("/:uuid.:ext?", function(req, res) {
|
router.get("/:uuid.:ext?", function(req, res) {
|
||||||
var uuid = (req.params.uuid || "").toLowerCase();
|
var uuid = (req.params.uuid || "");
|
||||||
var size = parseInt(req.query.size) || config.default_size;
|
var size = parseInt(req.query.size) || config.default_size;
|
||||||
var def = req.query.default;
|
var def = req.query.default;
|
||||||
var helm = req.query.hasOwnProperty("helm");
|
var helm = req.query.hasOwnProperty("helm");
|
||||||
|
|||||||
@ -8,7 +8,7 @@ var lwip = require("lwip");
|
|||||||
|
|
||||||
/* GET skin request. */
|
/* GET skin request. */
|
||||||
router.get("/:uuid.:ext?", function(req, res) {
|
router.get("/:uuid.:ext?", function(req, res) {
|
||||||
var uuid = (req.params.uuid || "").toLowerCase();
|
var uuid = (req.params.uuid || "");
|
||||||
var def = req.query.default;
|
var def = req.query.default;
|
||||||
var start = new Date();
|
var start = new Date();
|
||||||
var etag = null;
|
var etag = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user