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;
|
||||
};
|
||||
}
|
||||
|
||||
// exracts the skin url of a +profile+ object
|
||||
// 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) {
|
||||
if (err) {
|
||||
logging.error(uuid + " error while opening skin file: " + err);
|
||||
callback(err, null)
|
||||
callback(err, null);
|
||||
} else {
|
||||
callback(null, buf);
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
var networking = require("../modules/networking");
|
||||
var logging = require("../modules/logging");
|
||||
var helpers = require("../modules/helpers");
|
||||
var config = require("../modules/config");
|
||||
@ -49,7 +48,7 @@ module.exports = function(req, res) {
|
||||
logging.log(uuid + " - " + human_status[status]);
|
||||
if (err) {
|
||||
logging.error(uuid + " " + err);
|
||||
if (err.code == "ENOENT") {
|
||||
if (err.code === "ENOENT") {
|
||||
cache.remove_hash(uuid);
|
||||
}
|
||||
}
|
||||
@ -75,7 +74,7 @@ module.exports = function(req, res) {
|
||||
}
|
||||
|
||||
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");
|
||||
res.writeHead(301, {
|
||||
"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
|
||||
// custom images will not be
|
||||
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");
|
||||
res.writeHead(301, {
|
||||
"Cache-Control": "max-age=" + config.browser_cache_time + ", public",
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
var networking = require("../modules/networking");
|
||||
var logging = require("../modules/logging");
|
||||
var helpers = require("../modules/helpers");
|
||||
var config = require("../modules/config");
|
||||
@ -52,7 +51,7 @@ module.exports = function(req, res) {
|
||||
}
|
||||
|
||||
function handle_default(http_status, uuid) {
|
||||
if (def && def != "steve" && def != "alex") {
|
||||
if (def && def !== "steve" && def !== "alex") {
|
||||
logging.log(uuid + " status: 301");
|
||||
res.writeHead(301, {
|
||||
"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];
|
||||
logging.log(request.method + " " + request.url.href);
|
||||
if (request.method == "GET" || request.method == "HEAD") {
|
||||
if (request.method === "GET" || request.method === "HEAD") {
|
||||
try {
|
||||
switch (local_path) {
|
||||
case "":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user