diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-21 09:56:59 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-21 09:56:59 +0100 |
commit | 225a89c2afbbe53cf39ffa7ea0cd485095a1d5f5 (patch) | |
tree | 9dc8fa039e820229fd3ecb386d6f63bf02e16698 /server/helpers/custom-validators/webfinger.ts | |
parent | 6725d05c5f71e0cdf0deba6692220b73e42e7ffa (diff) | |
download | PeerTube-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/webfinger.ts')
-rw-r--r-- | server/helpers/custom-validators/webfinger.ts | 5 |
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 @@ | |||
1 | import { CONFIG } from '../../initializers' | 1 | import { CONFIG, REMOTE_SCHEME } from '../../initializers' |
2 | import { sanitizeHost } from '../core-utils' | ||
2 | import { exists } from './misc' | 3 | import { exists } from './misc' |
3 | 4 | ||
4 | function isWebfingerResourceValid (value: string) { | 5 | function 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 | // --------------------------------------------------------------------------- |