X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fuser-subscriptions.ts;h=2356745d7e6438c7236c36fa3130766681b19174;hb=7d14d4d2ca82cc43c93b45bb1f90af975cfbf67c;hp=fd82ed017ac5b05d0ba9fc651617edda504c7ffa;hpb=dae86118ed5d4026d04acb9d0e36829b9ad8eb4e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts index fd82ed017..2356745d7 100644 --- a/server/middlewares/validators/user-subscriptions.ts +++ b/server/middlewares/validators/user-subscriptions.ts @@ -5,8 +5,8 @@ import { logger } from '../../helpers/logger' import { areValidationErrors } from './utils' import { ActorFollowModel } from '../../models/activitypub/actor-follow' import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' -import { CONFIG } from '../../initializers' import { toArray } from '../../helpers/custom-validators/misc' +import { WEBSERVER } from '../../initializers/constants' const userSubscriptionAddValidator = [ body('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'), @@ -43,7 +43,7 @@ const userSubscriptionGetValidator = [ if (areValidationErrors(req, res)) return let [ name, host ] = req.params.uri.split('@') - if (host === CONFIG.WEBSERVER.HOST) host = null + if (host === WEBSERVER.HOST) host = null const user = res.locals.oauth.token.User const subscription = await ActorFollowModel.loadByActorAndTargetNameAndHostForAPI(user.Account.Actor.id, name, host)