mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
allow custom default image, fix #17
This commit is contained in:
parent
18bec6a196
commit
1dd1ee4d34
@ -93,11 +93,19 @@ router.get('/avatars/:uuid.:ext?', function(req, res) {
|
|||||||
|
|
||||||
function handle_default(http_status, img_status) {
|
function handle_default(http_status, img_status) {
|
||||||
if (def != "steve" && def != "alex") {
|
if (def != "steve" && def != "alex") {
|
||||||
def = skins.default_skin(uuid);
|
res.writeHead(301, {
|
||||||
|
'Cache-Control': 'max-age=' + config.browser_cache_time + ', public',
|
||||||
|
'Response-Time': new Date() - start,
|
||||||
|
'X-Storage-Type': human_status[img_status],
|
||||||
|
'Location': def
|
||||||
|
});
|
||||||
|
res.end();
|
||||||
|
} else {
|
||||||
|
def = def || skins.default_skin;
|
||||||
|
skins.resize_img("public/images/" + def + ".png", size, function(err, image) {
|
||||||
|
sendimage(http_status, img_status, image);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
skins.resize_img("public/images/" + def + ".png", size, function(err, image) {
|
|
||||||
sendimage(http_status, img_status, image);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendimage(http_status, img_status, image) {
|
function sendimage(http_status, img_status, image) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user