aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-21 09:56:59 +0100
committerChocobozzz <me@florianbigard.com>2017-12-21 09:56:59 +0100
commit225a89c2afbbe53cf39ffa7ea0cd485095a1d5f5 (patch)
tree9dc8fa039e820229fd3ecb386d6f63bf02e16698 /server/helpers/custom-validators
parent6725d05c5f71e0cdf0deba6692220b73e42e7ffa (diff)
downloadPeerTube-225a89c2afbbe53cf39ffa7ea0cd485095a1d5f5.tar.gz
PeerTube-225a89c2afbbe53cf39ffa7ea0cd485095a1d5f5.tar.zst
PeerTube-225a89c2afbbe53cf39ffa7ea0cd485095a1d5f5.zip
Sanitize url to not end with implicit ports
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/webfinger.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/webfinger.ts b/server/helpers/custom-validators/webfinger.ts
index 1b9aad444..46f1ac210 100644
--- a/server/helpers/custom-validators/webfinger.ts
+++ b/server/helpers/custom-validators/webfinger.ts
@@ -1,4 +1,5 @@
1import { CONFIG } from '../../initializers' 1import { CONFIG, REMOTE_SCHEME } from '../../initializers'
2import { sanitizeHost } from '../core-utils'
2import { exists } from './misc' 3import { exists } from './misc'
3 4
4function isWebfingerResourceValid (value: string) { 5function isWebfingerResourceValid (value: string) {
@@ -11,7 +12,7 @@ function isWebfingerResourceValid (value: string) {
11 12
12 const host = actorParts[1] 13 const host = actorParts[1]
13 14
14 return host === CONFIG.WEBSERVER.HOSTNAME || host === CONFIG.WEBSERVER.HOST 15 return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOSTNAME
15} 16}
16 17
17// --------------------------------------------------------------------------- 18// ---------------------------------------------------------------------------