From 0405ab52dc0f445b88f8de76e30d6e6719196023 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Dec 2017 14:21:14 +0100 Subject: Set port if not specified in webfinger --- server/middlewares/validators/webfinger.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/middlewares/validators') diff --git a/server/middlewares/validators/webfinger.ts b/server/middlewares/validators/webfinger.ts index 2c8351799..894c72498 100644 --- a/server/middlewares/validators/webfinger.ts +++ b/server/middlewares/validators/webfinger.ts @@ -1,6 +1,6 @@ import * as express from 'express' import { query } from 'express-validator/check' -import { logger } from '../../helpers' +import { getHostWithPort, logger } from '../../helpers' import { isWebfingerResourceValid } from '../../helpers/custom-validators/webfinger' import { ActorModel } from '../../models/activitypub/actor' import { areValidationErrors } from './utils' @@ -14,7 +14,7 @@ const webfingerValidator = [ if (areValidationErrors(req, res)) return // Remove 'acct:' from the beginning of the string - const nameWithHost = req.query.resource.substr(5) + const nameWithHost = getHostWithPort(req.query.resource.substr(5)) const [ name ] = nameWithHost.split('@') const actor = await ActorModel.loadLocalByName(name) -- cgit v1.2.3