From 225a89c2afbbe53cf39ffa7ea0cd485095a1d5f5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Dec 2017 09:56:59 +0100 Subject: Sanitize url to not end with implicit ports --- server/helpers/custom-validators/webfinger.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/helpers/custom-validators') 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 @@ -import { CONFIG } from '../../initializers' +import { CONFIG, REMOTE_SCHEME } from '../../initializers' +import { sanitizeHost } from '../core-utils' import { exists } from './misc' function isWebfingerResourceValid (value: string) { @@ -11,7 +12,7 @@ function isWebfingerResourceValid (value: string) { const host = actorParts[1] - return host === CONFIG.WEBSERVER.HOSTNAME || host === CONFIG.WEBSERVER.HOST + return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOSTNAME } // --------------------------------------------------------------------------- -- cgit v1.2.3