mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
rename contents to file_buffer for clarity
This commit is contained in:
parent
f031616984
commit
341eb5b41b
@ -18,16 +18,16 @@ function asset_request(req, res) {
|
|||||||
var filename = __dirname + "/public/" + req.url.pathname;
|
var filename = __dirname + "/public/" + req.url.pathname;
|
||||||
fs.exists(filename, function(exists) {
|
fs.exists(filename, function(exists) {
|
||||||
if (exists) {
|
if (exists) {
|
||||||
fs.readFile(filename, function(err, contents) {
|
fs.readFile(filename, function(err, file_buffer) {
|
||||||
if (err) {
|
if (err) {
|
||||||
res.writeHead(500, {"Content-type" : "text/plain"});
|
res.writeHead(500, {"Content-type" : "text/plain"});
|
||||||
res.end("Internal Server Error");
|
res.end("Internal Server Error");
|
||||||
} else {
|
} else {
|
||||||
res.writeHead(200, {
|
res.writeHead(200, {
|
||||||
"Content-type" : mime.lookup(filename),
|
"Content-type" : mime.lookup(filename),
|
||||||
"Content-Length": contents.length
|
"Content-Length": file_buffer.length
|
||||||
});
|
});
|
||||||
res.end(contents);
|
res.end(file_buffer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user