mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
use status -2 for 404s
human_status (response.js) defines code -2 as 'user error'. 404 is definitely a user error, so using that makes sense. eventually we should change the whole status code thing with #120
This commit is contained in:
@@ -52,8 +52,9 @@ module.exports = function(req, callback) {
|
||||
// check for extra paths
|
||||
if (req.url.path_list.length > 2) {
|
||||
callback({
|
||||
status: -3,
|
||||
body: "Invalid URL Path"
|
||||
status: -2,
|
||||
body: "Invalid Path",
|
||||
code: 404
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,9 @@ module.exports = function(req, callback) {
|
||||
// check for extra paths
|
||||
if (req.url.path_list.length > 2) {
|
||||
callback({
|
||||
status: -3,
|
||||
body: "Invalid URL Path"
|
||||
status: -2,
|
||||
body: "Invalid Path",
|
||||
code: 404
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,9 @@ module.exports = function(req, callback) {
|
||||
// check for extra paths
|
||||
if (req.url.path_list.length > 3) {
|
||||
callback({
|
||||
status: -3,
|
||||
body: "Invalid URL Path"
|
||||
status: -2,
|
||||
body: "Invalid Path",
|
||||
code: 404
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,8 +59,9 @@ module.exports = function(req, callback) {
|
||||
// check for extra paths
|
||||
if (req.url.path_list.length > 2) {
|
||||
callback({
|
||||
status: -3,
|
||||
body: "Invalid URL Path"
|
||||
status: -2,
|
||||
body: "Invalid Path",
|
||||
code: 404
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user