aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/lib/activitypub/crawl.ts3
-rw-r--r--server/lib/job-queue/handlers/utils/activitypub-http-utils.ts2
-rw-r--r--server/middlewares/activitypub.ts2
3 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/activitypub/crawl.ts b/server/lib/activitypub/crawl.ts
index 0ba59b47d..686eef04d 100644
--- a/server/lib/activitypub/crawl.ts
+++ b/server/lib/activitypub/crawl.ts
@@ -3,8 +3,7 @@ import { doRequest } from '../../helpers/requests'
3import { logger } from '../../helpers/logger' 3import { logger } from '../../helpers/logger'
4import * as Bluebird from 'bluebird' 4import * as Bluebird from 'bluebird'
5import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub' 5import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub'
6import { checkUrlsSameHost } from '../../helpers/activitypub' 6import { parse } from 'url'
7import { parse } from "url"
8 7
9type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>) 8type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>)
10type CleanerFunction = (startedDate: Date) => (Promise<any> | Bluebird<any>) 9type CleanerFunction = (startedDate: Date) => (Promise<any> | Bluebird<any>)
diff --git a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts
index 5c25625f6..cdee1f6fd 100644
--- a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts
+++ b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts
@@ -28,7 +28,7 @@ async function buildSignedRequestOptions (payload: Payload) {
28 actor = await getServerActor() 28 actor = await getServerActor()
29 } 29 }
30 30
31 const keyId = actor.getWebfingerUrl() 31 const keyId = actor.url
32 return { 32 return {
33 algorithm: HTTP_SIGNATURE.ALGORITHM, 33 algorithm: HTTP_SIGNATURE.ALGORITHM,
34 authorizationHeaderName: HTTP_SIGNATURE.HEADER_NAME, 34 authorizationHeaderName: HTTP_SIGNATURE.HEADER_NAME,
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts
index 88cf342ee..b1e5b5236 100644
--- a/server/middlewares/activitypub.ts
+++ b/server/middlewares/activitypub.ts
@@ -74,6 +74,8 @@ async function checkHttpSignature (req: Request, res: Response) {
74 74
75 const verified = isHTTPSignatureVerified(parsed, actor) 75 const verified = isHTTPSignatureVerified(parsed, actor)
76 if (verified !== true) { 76 if (verified !== true) {
77 logger.warn('Signature from %s is invalid', actorUrl, { parsed })
78
77 res.sendStatus(403) 79 res.sendStatus(403)
78 return false 80 return false
79 } 81 }