mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
always show http status
This commit is contained in:
parent
cbbfb73bea
commit
8ef7bd5937
@ -60,7 +60,6 @@ module.exports = function(req, res) {
|
||||
}
|
||||
logging.debug("Etag: " + req.headers["if-none-match"]);
|
||||
logging.debug("matches: " + matches);
|
||||
logging.log("status: " + http_status);
|
||||
sendimage(http_status, status, image);
|
||||
} else {
|
||||
handle_default(404, status);
|
||||
@ -74,6 +73,7 @@ module.exports = function(req, res) {
|
||||
|
||||
function handle_default(http_status, img_status) {
|
||||
if (def && def != "steve" && def != "alex") {
|
||||
logging.log("status: 301");
|
||||
res.writeHead(301, {
|
||||
"Cache-Control": "max-age=" + config.browser_cache_time + ", public",
|
||||
"Response-Time": new Date() - start,
|
||||
@ -91,6 +91,7 @@ module.exports = function(req, res) {
|
||||
}
|
||||
|
||||
function sendimage(http_status, img_status, image) {
|
||||
logging.log("status: " + http_status);
|
||||
res.writeHead(http_status, {
|
||||
"Content-Type": "image/png",
|
||||
"Cache-Control": "max-age=" + config.browser_cache_time + ", public",
|
||||
|
||||
@ -75,7 +75,6 @@ module.exports = function(req, res) {
|
||||
}
|
||||
logging.log("matches: " + matches);
|
||||
logging.log("Etag: " + req.headers["if-none-match"]);
|
||||
logging.log("status: " + http_status);
|
||||
sendimage(http_status, status, image);
|
||||
} else {
|
||||
logging.log("image not found, using default.");
|
||||
@ -93,6 +92,7 @@ module.exports = function(req, res) {
|
||||
// custom images will not be
|
||||
function handle_default(http_status, img_status) {
|
||||
if (def && def != "steve" && def != "alex") {
|
||||
logging.log("status: 301");
|
||||
res.writeHead(301, {
|
||||
"Cache-Control": "max-age=" + config.browser_cache_time + ", public",
|
||||
"Response-Time": new Date() - start,
|
||||
@ -120,6 +120,7 @@ module.exports = function(req, res) {
|
||||
}
|
||||
|
||||
function sendimage(http_status, img_status, image) {
|
||||
logging.log("status: " + http_status);
|
||||
res.writeHead(http_status, {
|
||||
"Content-Type": "image/png",
|
||||
"Cache-Control": "max-age=" + config.browser_cache_time + ", public",
|
||||
|
||||
@ -41,7 +41,6 @@ module.exports = function(req, res) {
|
||||
}
|
||||
logging.debug("Etag: " + req.headers["if-none-match"]);
|
||||
logging.debug("matches: " + matches);
|
||||
logging.log("status: " + http_status);
|
||||
sendimage(http_status, image);
|
||||
} else {
|
||||
handle_default(404);
|
||||
@ -55,6 +54,7 @@ module.exports = function(req, res) {
|
||||
|
||||
function handle_default(http_status) {
|
||||
if (def && def != "steve" && def != "alex") {
|
||||
logging.log("status: 301");
|
||||
res.writeHead(301, {
|
||||
"Cache-Control": "max-age=" + config.browser_cache_time + ", public",
|
||||
"Response-Time": new Date() - start,
|
||||
@ -74,6 +74,7 @@ module.exports = function(req, res) {
|
||||
}
|
||||
|
||||
function sendimage(http_status, image) {
|
||||
logging.log("status: " + http_status);
|
||||
res.writeHead(http_status, {
|
||||
"Content-Type": "image/png",
|
||||
"Cache-Control": "max-age=" + config.browser_cache_time + ", public",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user