format
This commit is contained in:
1 parent
cb02bb0de7
commit
43ac0174d1
1 file changed
+2
-7
@@ -164,11 +164,7 @@ const createMonitorBodyValidation = joi.object({
|
||||
.custom((value, helpers) => {
|
||||
// 1. Standard URLs: must have protocol and pass canParse()
|
||||
if (/^(https?:\/\/)/.test(value)) {
|
||||
if (
|
||||
typeof URL !== "undefined" &&
|
||||
typeof URL.canParse === "function" &&
|
||||
URL.canParse(value)
|
||||
) {
|
||||
if (typeof URL !== "undefined" && typeof URL.canParse === "function" && URL.canParse(value)) {
|
||||
return value;
|
||||
}
|
||||
// else, it's a malformed URL with protocol
|
||||
@@ -197,8 +193,7 @@ const createMonitorBodyValidation = joi.object({
|
||||
.messages({
|
||||
"string.empty": "This field is required.",
|
||||
"string.uri": "The URL you provided is not valid.",
|
||||
"string.invalidUrl":
|
||||
"Please enter a valid URL, hostname, or container name (with optional port).",
|
||||
"string.invalidUrl": "Please enter a valid URL, hostname, or container name (with optional port).",
|
||||
}),
|
||||
ignoreTlsErrors: joi.boolean().default(false),
|
||||
port: joi.number(),
|
||||
|
||||
Reference in new issue
Block a user