Skip to content

Commit

Permalink
custom: support url contains parens
Browse files Browse the repository at this point in the history
  • Loading branch information
IITII authored Feb 2, 2024
1 parent 7b2a903 commit c4d4097
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/handlers/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const createLink = [
.customSanitizer(addProtocol)
.custom(
value =>
urlRegex({ exact: true, strict: false }).test(value) ||
urlRegex({ exact: true, strict: false, parens: true }).test(value) ||
/^(?!https?)(\w+):\/\//.test(value)
)
.withMessage("URL is not valid.")
Expand Down Expand Up @@ -139,7 +139,7 @@ export const editLink = [
.customSanitizer(addProtocol)
.custom(
value =>
urlRegex({ exact: true, strict: false }).test(value) ||
urlRegex({ exact: true, strict: false, parens: true }).test(value) ||
/^(?!https?)(\w+):\/\//.test(value)
)
.withMessage("URL is not valid.")
Expand Down

0 comments on commit c4d4097

Please sign in to comment.