always show http status

This commit is contained in:
jomo 2015-01-04 03:58:40 +01:00
parent cbbfb73bea
commit 8ef7bd5937
3 changed files with 6 additions and 3 deletions

View File

@ -60,7 +60,6 @@ module.exports = function(req, res) {
} }
logging.debug("Etag: " + req.headers["if-none-match"]); logging.debug("Etag: " + req.headers["if-none-match"]);
logging.debug("matches: " + matches); logging.debug("matches: " + matches);
logging.log("status: " + http_status);
sendimage(http_status, status, image); sendimage(http_status, status, image);
} else { } else {
handle_default(404, status); handle_default(404, status);
@ -74,6 +73,7 @@ module.exports = function(req, res) {
function handle_default(http_status, img_status) { function handle_default(http_status, img_status) {
if (def && def != "steve" && def != "alex") { if (def && def != "steve" && def != "alex") {
logging.log("status: 301");
res.writeHead(301, { res.writeHead(301, {
"Cache-Control": "max-age=" + config.browser_cache_time + ", public", "Cache-Control": "max-age=" + config.browser_cache_time + ", public",
"Response-Time": new Date() - start, "Response-Time": new Date() - start,
@ -91,6 +91,7 @@ module.exports = function(req, res) {
} }
function sendimage(http_status, img_status, image) { function sendimage(http_status, img_status, image) {
logging.log("status: " + http_status);
res.writeHead(http_status, { res.writeHead(http_status, {
"Content-Type": "image/png", "Content-Type": "image/png",
"Cache-Control": "max-age=" + config.browser_cache_time + ", public", "Cache-Control": "max-age=" + config.browser_cache_time + ", public",

View File

@ -75,7 +75,6 @@ module.exports = function(req, res) {
} }
logging.log("matches: " + matches); logging.log("matches: " + matches);
logging.log("Etag: " + req.headers["if-none-match"]); logging.log("Etag: " + req.headers["if-none-match"]);
logging.log("status: " + http_status);
sendimage(http_status, status, image); sendimage(http_status, status, image);
} else { } else {
logging.log("image not found, using default."); logging.log("image not found, using default.");
@ -93,6 +92,7 @@ module.exports = function(req, res) {
// custom images will not be // custom images will not be
function handle_default(http_status, img_status) { function handle_default(http_status, img_status) {
if (def && def != "steve" && def != "alex") { if (def && def != "steve" && def != "alex") {
logging.log("status: 301");
res.writeHead(301, { res.writeHead(301, {
"Cache-Control": "max-age=" + config.browser_cache_time + ", public", "Cache-Control": "max-age=" + config.browser_cache_time + ", public",
"Response-Time": new Date() - start, "Response-Time": new Date() - start,
@ -120,6 +120,7 @@ module.exports = function(req, res) {
} }
function sendimage(http_status, img_status, image) { function sendimage(http_status, img_status, image) {
logging.log("status: " + http_status);
res.writeHead(http_status, { res.writeHead(http_status, {
"Content-Type": "image/png", "Content-Type": "image/png",
"Cache-Control": "max-age=" + config.browser_cache_time + ", public", "Cache-Control": "max-age=" + config.browser_cache_time + ", public",

View File

@ -41,7 +41,6 @@ module.exports = function(req, res) {
} }
logging.debug("Etag: " + req.headers["if-none-match"]); logging.debug("Etag: " + req.headers["if-none-match"]);
logging.debug("matches: " + matches); logging.debug("matches: " + matches);
logging.log("status: " + http_status);
sendimage(http_status, image); sendimage(http_status, image);
} else { } else {
handle_default(404); handle_default(404);
@ -55,6 +54,7 @@ module.exports = function(req, res) {
function handle_default(http_status) { function handle_default(http_status) {
if (def && def != "steve" && def != "alex") { if (def && def != "steve" && def != "alex") {
logging.log("status: 301");
res.writeHead(301, { res.writeHead(301, {
"Cache-Control": "max-age=" + config.browser_cache_time + ", public", "Cache-Control": "max-age=" + config.browser_cache_time + ", public",
"Response-Time": new Date() - start, "Response-Time": new Date() - start,
@ -74,6 +74,7 @@ module.exports = function(req, res) {
} }
function sendimage(http_status, image) { function sendimage(http_status, image) {
logging.log("status: " + http_status);
res.writeHead(http_status, { res.writeHead(http_status, {
"Content-Type": "image/png", "Content-Type": "image/png",
"Cache-Control": "max-age=" + config.browser_cache_time + ", public", "Cache-Control": "max-age=" + config.browser_cache_time + ", public",