X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fwebfinger.ts;h=d8c1232ce4cd66578a4eba17e1bd8ee39e2bbed4;hb=1d6e5dfc376f3c0c2120055cc093161e76419f98;hp=c53db402795eb562c5db634bb2e6a65b723927ee;hpb=50d6de9c286abcb34ff4234d56d9cbb803db7665;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/webfinger.ts b/server/helpers/custom-validators/webfinger.ts index c53db4027..d8c1232ce 100644 --- a/server/helpers/custom-validators/webfinger.ts +++ b/server/helpers/custom-validators/webfinger.ts @@ -1,4 +1,5 @@ -import { CONFIG } from '../../initializers' +import { CONFIG, REMOTE_SCHEME } from '../../initializers' +import { sanitizeHost } from '../core-utils' import { exists } from './misc' function isWebfingerResourceValid (value: string) { @@ -10,8 +11,7 @@ function isWebfingerResourceValid (value: string) { if (actorParts.length !== 2) return false const host = actorParts[1] - - return host === CONFIG.WEBSERVER.HOST + return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOST } // ---------------------------------------------------------------------------