Browse Source

fix: validating report host

poeti8 6 năm trước cách đây
mục cha
commit
417150f9ea
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      server/handlers/validators.ts

+ 1 - 0
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.`)
 ];