add Access-Control-Allow-Origin, fix #19

This commit is contained in:
jomo 2014-11-25 00:37:14 +01:00
parent 95ebaf86c5
commit 7d09da8384

View File

@ -30,6 +30,7 @@ router.get('/skins/:uuid.:ext?', function(req, res) {
'Location': "http://textures.minecraft.net/texture/" + hash,
'Cache-Control': 'max-age=' + config.browser_cache_time + ', public',
'Response-Time': new Date() - start,
'Access-Control-Allow-Origin': '*',
'X-Storage-Type': human_status[status]
});
res.end();
@ -37,6 +38,7 @@ router.get('/skins/:uuid.:ext?', function(req, res) {
res.writeHead(404, {
'Cache-Control': 'max-age=' + config.browser_cache_time + ', public',
'Response-Time': new Date() - start,
'Access-Control-Allow-Origin': '*',
'X-Storage-Type': human_status[status]
});
res.end("404 Not found");
@ -108,6 +110,7 @@ router.get('/avatars/:uuid.:ext?', function(req, res) {
'Cache-Control': 'max-age=' + config.browser_cache_time + ', public',
'Response-Time': new Date() - start,
'X-Storage-Type': human_status[img_status],
'Access-Control-Allow-Origin': '*',
'Location': def
});
res.end();
@ -125,6 +128,7 @@ router.get('/avatars/:uuid.:ext?', function(req, res) {
'Cache-Control': 'max-age=' + config.browser_cache_time + ', public',
'Response-Time': new Date() - start,
'X-Storage-Type': human_status[img_status],
'Access-Control-Allow-Origin': '*',
'Etag': '"' + etag + '"'
});
res.end(http_status == 304 ? null : image);