diff options
author | poeti8 <ezzati.upt@gmail.com> | 2020-07-11 18:17:02 +0300 |
---|---|---|
committer | poeti8 <ezzati.upt@gmail.com> | 2020-07-11 18:18:06 +0300 |
commit | e45321668b371b53ce092889f1869a0c163dfb1f (patch) | |
tree | 5c0b027a5a7de464f84b09447b912155053c9876 /server | |
parent | cdf0a13f7722090dc4c10d232aa689b0b0cdd730 (diff) |
fix: skip if default domain is used as custom domain. Resolves #287
Diffstat (limited to 'server')
-rw-r--r-- | server/handlers/validators.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/handlers/validators.ts b/server/handlers/validators.ts index 105ec69..e76404a 100644 --- a/server/handlers/validators.ts +++ b/server/handlers/validators.ts @@ -88,7 +88,13 @@ export const createLink = [ .isString() .withMessage("Domain should be string.") .customSanitizer(value => value.toLowerCase()) + .customSanitizer(value => URL.parse(value).hostname || value) .custom(async (address, { req }) => { + if (address === env.DEFAULT_DOMAIN) { + req.body.domain = null; + return; + } + const domain = await query.domain.find({ address, user_id: req.user.id |