diff options
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/activitypub.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/user-subscriptions.ts | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts index 0064a4760..261b9f690 100644 --- a/server/middlewares/activitypub.ts +++ b/server/middlewares/activitypub.ts | |||
@@ -125,7 +125,7 @@ async function checkJsonLDSignature (req: Request, res: Response) { | |||
125 | return wrapWithSpanAndContext('peertube.activitypub.JSONLDSignature', async () => { | 125 | return wrapWithSpanAndContext('peertube.activitypub.JSONLDSignature', async () => { |
126 | const signatureObject: ActivityPubSignature = req.body.signature | 126 | const signatureObject: ActivityPubSignature = req.body.signature |
127 | 127 | ||
128 | if (!signatureObject || !signatureObject.creator) { | 128 | if (!signatureObject?.creator) { |
129 | res.fail({ | 129 | res.fail({ |
130 | status: HttpStatusCode.FORBIDDEN_403, | 130 | status: HttpStatusCode.FORBIDDEN_403, |
131 | message: 'Object and creator signature do not match' | 131 | message: 'Object and creator signature do not match' |
diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts index d01043c17..d8d3fc28b 100644 --- a/server/middlewares/validators/user-subscriptions.ts +++ b/server/middlewares/validators/user-subscriptions.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { arrayify } from '@shared/core-utils' | ||
2 | import express from 'express' | 1 | import express from 'express' |
3 | import { body, param, query } from 'express-validator' | 2 | import { body, param, query } from 'express-validator' |
3 | import { arrayify } from '@shared/core-utils' | ||
4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 4 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
5 | import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' | 5 | import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' |
6 | import { WEBSERVER } from '../../initializers/constants' | 6 | import { WEBSERVER } from '../../initializers/constants' |
@@ -60,7 +60,7 @@ const userSubscriptionGetValidator = [ | |||
60 | state: 'accepted' | 60 | state: 'accepted' |
61 | }) | 61 | }) |
62 | 62 | ||
63 | if (!subscription || !subscription.ActorFollowing.VideoChannel) { | 63 | if (!subscription?.ActorFollowing.VideoChannel) { |
64 | return res.fail({ | 64 | return res.fail({ |
65 | status: HttpStatusCode.NOT_FOUND_404, | 65 | status: HttpStatusCode.NOT_FOUND_404, |
66 | message: `Subscription ${req.params.uri} not found.` | 66 | message: `Subscription ${req.params.uri} not found.` |