X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fwebfinger.ts;h=d8c1232ce4cd66578a4eba17e1bd8ee39e2bbed4;hb=f6a7c82ca51896a433bc2264c52afd6981c7c4c6;hp=1b9aad444f0ac835d91e0d3b3d2a37816ff59b00;hpb=232f04c809bf25952b790da5685b36f05cb19750;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/webfinger.ts b/server/helpers/custom-validators/webfinger.ts index 1b9aad444..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.HOSTNAME || host === CONFIG.WEBSERVER.HOST + return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOST } // ---------------------------------------------------------------------------