badmfck-api-server 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -209,6 +209,16 @@ class Validator {
|
|
|
209
209
|
caseValue = object[i];
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
|
+
const val = (object[i] + "").toLowerCase().trim();
|
|
213
|
+
if (typeof i === "object") {
|
|
214
|
+
const keys = Object.keys(i);
|
|
215
|
+
for (const key of keys) {
|
|
216
|
+
if ((i[key] + "").toLowerCase().trim() === val) {
|
|
217
|
+
caseValue = i[key];
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
212
222
|
}
|
|
213
223
|
errors.push("wrong value for field '" + parentPath + i + "'" + (caseValue ? ", check case for: " + caseValue : ""));
|
|
214
224
|
}
|
|
@@ -6,10 +6,10 @@ class DefaultErrors {
|
|
|
6
6
|
static NOT_IMPLEMENTED = { code: 1, message: "Not implemented" };
|
|
7
7
|
static UNKNOWN_REQUEST = { code: 2, message: "Unknown request" };
|
|
8
8
|
static JSON_MALFORMED = { code: 3, message: "JSON malformed" };
|
|
9
|
-
static FILE_TOO_LARGE = { code: 4, message: "File is too large" };
|
|
9
|
+
static FILE_TOO_LARGE = { code: 4, message: "File is too large", httpStatus: 413 };
|
|
10
10
|
static CANT_SEND_FILE = { code: 5, message: "Can't send file" };
|
|
11
|
-
static FILE_NOT_EXISTS = { code: 5, message: "File not exists" };
|
|
12
|
-
static UNAUTHORIZED = { code: 6, message: "Unauthorized" };
|
|
11
|
+
static FILE_NOT_EXISTS = { code: 5, message: "File not exists", httpStatus: 404 };
|
|
12
|
+
static UNAUTHORIZED = { code: 6, message: "Unauthorized", httpStatus: 401 };
|
|
13
13
|
static BAD_REQUEST = { code: 7, message: "Bad request", httpStatus: 400 };
|
|
14
14
|
static SERVICE_NOT_WORKING = { code: 8, message: "Service not working" };
|
|
15
15
|
static TIMEOUT = { code: 9, message: "Timeout", httpStatus: 408 };
|