mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +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) {
|
||||
logging.log(uuid + " cache: updating timestamp");
|
||||
var time = new Date().getTime();
|
||||
// store uuid in lower case if not null
|
||||
uuid = uuid && uuid.toLowerCase();
|
||||
redis.hmset(uuid, "t", time);
|
||||
update_file_date(hash);
|
||||
};
|
||||
@ -78,6 +80,8 @@ exp.save_hash = function(uuid, hash) {
|
||||
// {hash: "0123456789abcdef", time: 1414881524512}
|
||||
// null when uuid unkown
|
||||
exp.get_details = function(uuid, callback) {
|
||||
// get uuid in lower case if not null
|
||||
uuid = uuid && uuid.toLowerCase();
|
||||
redis.hgetall(uuid, function(err, data) {
|
||||
var details = null;
|
||||
if (data) {
|
||||
|
||||
@ -15,7 +15,7 @@ var human_status = {
|
||||
|
||||
/* GET avatar request. */
|
||||
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 def = req.query.default;
|
||||
var helm = req.query.hasOwnProperty("helm");
|
||||
|
||||
@ -8,7 +8,7 @@ var lwip = require("lwip");
|
||||
|
||||
/* GET skin request. */
|
||||
router.get("/:uuid.:ext?", function(req, res) {
|
||||
var uuid = (req.params.uuid || "").toLowerCase();
|
||||
var uuid = (req.params.uuid || "");
|
||||
var def = req.query.default;
|
||||
var start = new Date();
|
||||
var etag = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user