Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thedevs-network/kutt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorpoeti8 <ezzati.upt@gmail.com>2020-02-05 17:00:43 +0300
committerpoeti8 <ezzati.upt@gmail.com>2020-02-05 17:00:43 +0300
commit417150f9ea4dea6d6817291cc7341bc7ae6fcf29 (patch)
tree2b6f11ac70b2d0357f22bb0768bfccf77b93db86 /server
parent1d9e136464906ff8808e76503f01968905f8526e (diff)
fix: validating report host
Diffstat (limited to 'server')
-rw-r--r--server/handlers/validators.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/server/handlers/validators.ts b/server/handlers/validators.ts
index 5bc4508..322cfe5 100644
--- a/server/handlers/validators.ts
+++ b/server/handlers/validators.ts
@@ -164,6 +164,7 @@ export const reportLink = [
checkFalsy: true,
checkNull: true
})
+ .customSanitizer(addProtocol)
.custom(value => URL.parse(value).hostname === env.DEFAULT_DOMAIN)
.withMessage(`You can only report a ${env.DEFAULT_DOMAIN} link.`)
];