mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
Code cleanup
This commit is contained in:
parent
32c3ece12d
commit
ffcd023c05
@ -21,7 +21,7 @@ function extract_url(profile, property) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
};
|
}
|
||||||
|
|
||||||
// exracts the skin url of a +profile+ object
|
// exracts the skin url of a +profile+ object
|
||||||
// returns null when no url found (user has no skin)
|
// returns null when no url found (user has no skin)
|
||||||
|
|||||||
@ -99,7 +99,7 @@ exp.open_skin = function(uuid, skinpath, callback) {
|
|||||||
fs.readFile(skinpath, function(err, buf) {
|
fs.readFile(skinpath, function(err, buf) {
|
||||||
if (err) {
|
if (err) {
|
||||||
logging.error(uuid + " error while opening skin file: " + err);
|
logging.error(uuid + " error while opening skin file: " + err);
|
||||||
callback(err, null)
|
callback(err, null);
|
||||||
} else {
|
} else {
|
||||||
callback(null, buf);
|
callback(null, buf);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
var networking = require("../modules/networking");
|
|
||||||
var logging = require("../modules/logging");
|
var logging = require("../modules/logging");
|
||||||
var helpers = require("../modules/helpers");
|
var helpers = require("../modules/helpers");
|
||||||
var config = require("../modules/config");
|
var config = require("../modules/config");
|
||||||
@ -49,7 +48,7 @@ module.exports = function(req, res) {
|
|||||||
logging.log(uuid + " - " + human_status[status]);
|
logging.log(uuid + " - " + human_status[status]);
|
||||||
if (err) {
|
if (err) {
|
||||||
logging.error(uuid + " " + err);
|
logging.error(uuid + " " + err);
|
||||||
if (err.code == "ENOENT") {
|
if (err.code === "ENOENT") {
|
||||||
cache.remove_hash(uuid);
|
cache.remove_hash(uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +74,7 @@ module.exports = function(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handle_default(http_status, img_status, uuid) {
|
function handle_default(http_status, img_status, uuid) {
|
||||||
if (def && def != "steve" && def != "alex") {
|
if (def && def !== "steve" && def !== "alex") {
|
||||||
logging.log(uuid + " status: 301");
|
logging.log(uuid + " 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",
|
||||||
|
|||||||
@ -90,7 +90,7 @@ module.exports = function(req, res) {
|
|||||||
// default alex/steve images can be rendered, but
|
// default alex/steve images can be rendered, but
|
||||||
// custom images will not be
|
// custom images will not be
|
||||||
function handle_default(http_status, img_status, uuid) {
|
function handle_default(http_status, img_status, uuid) {
|
||||||
if (def && def != "steve" && def != "alex") {
|
if (def && def !== "steve" && def !== "alex") {
|
||||||
logging.log(uuid + " status: 301");
|
logging.log(uuid + " 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",
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
var networking = require("../modules/networking");
|
|
||||||
var logging = require("../modules/logging");
|
var logging = require("../modules/logging");
|
||||||
var helpers = require("../modules/helpers");
|
var helpers = require("../modules/helpers");
|
||||||
var config = require("../modules/config");
|
var config = require("../modules/config");
|
||||||
@ -52,7 +51,7 @@ module.exports = function(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handle_default(http_status, uuid) {
|
function handle_default(http_status, uuid) {
|
||||||
if (def && def != "steve" && def != "alex") {
|
if (def && def !== "steve" && def !== "alex") {
|
||||||
logging.log(uuid + " status: 301");
|
logging.log(uuid + " 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",
|
||||||
|
|||||||
@ -46,7 +46,7 @@ function requestHandler(req, res) {
|
|||||||
|
|
||||||
var local_path = request.url.path_list[1];
|
var local_path = request.url.path_list[1];
|
||||||
logging.log(request.method + " " + request.url.href);
|
logging.log(request.method + " " + request.url.href);
|
||||||
if (request.method == "GET" || request.method == "HEAD") {
|
if (request.method === "GET" || request.method === "HEAD") {
|
||||||
try {
|
try {
|
||||||
switch (local_path) {
|
switch (local_path) {
|
||||||
case "":
|
case "":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user