浏览代码

always show http status

jomo 10 年之前
父节点
当前提交
8ef7bd5937
共有 3 个文件被更改,包括 6 次插入3 次删除
  1. 2 1
      routes/avatars.js
  2. 2 1
      routes/renders.js
  3. 2 1
      routes/skins.js

+ 2 - 1
routes/avatars.js

@@ -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",

+ 2 - 1
routes/renders.js

@@ -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",

+ 2 - 1
routes/skins.js

@@ -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",