X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fwebfinger.ts;h=bcdd136c6ae3123a2f15577ed4492774440ebb70;hb=c756bae079e02873f6433582ca14a092fec0db27;hp=c2dfccc96edebfd1aa6c1f8b091445fbb08590bc;hpb=4d7ce9218a3f695bf3d013cbdce1c5c6a5221927;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/webfinger.ts b/server/middlewares/validators/webfinger.ts index c2dfccc96..bcdd136c6 100644 --- a/server/middlewares/validators/webfinger.ts +++ b/server/middlewares/validators/webfinger.ts @@ -5,7 +5,7 @@ import { isWebfingerLocalResourceValid } from '../../helpers/custom-validators/w import { getHostWithPort } from '../../helpers/express-utils' import { logger } from '../../helpers/logger' import { ActorModel } from '../../models/actor/actor' -import { areValidationErrors } from './utils' +import { areValidationErrors } from './shared' const webfingerValidator = [ query('resource').custom(isWebfingerLocalResourceValid).withMessage('Should have a valid webfinger resource'), @@ -21,9 +21,10 @@ const webfingerValidator = [ const actor = await ActorModel.loadLocalUrlByName(name) if (!actor) { - return res.status(HttpStatusCode.NOT_FOUND_404) - .send({ error: 'Actor not found' }) - .end() + return res.fail({ + status: HttpStatusCode.NOT_FOUND_404, + message: 'Actor not found' + }) } res.locals.actorUrl = actor