diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/lib/activitypub/crawl.ts | 3 | ||||
-rw-r--r-- | server/lib/job-queue/handlers/utils/activitypub-http-utils.ts | 2 | ||||
-rw-r--r-- | server/middlewares/activitypub.ts | 2 |
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' | |||
3 | import { logger } from '../../helpers/logger' | 3 | import { logger } from '../../helpers/logger' |
4 | import * as Bluebird from 'bluebird' | 4 | import * as Bluebird from 'bluebird' |
5 | import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub' | 5 | import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub' |
6 | import { checkUrlsSameHost } from '../../helpers/activitypub' | 6 | import { parse } from 'url' |
7 | import { parse } from "url" | ||
8 | 7 | ||
9 | type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>) | 8 | type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>) |
10 | type CleanerFunction = (startedDate: Date) => (Promise<any> | Bluebird<any>) | 9 | type 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 | } |