1
0
Fork 0

Fix pleroma follow

This commit is contained in:
Chocobozzz 2019-04-25 15:19:53 +02:00
parent c0e71e849a
commit c28bcdd10a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 4 additions and 3 deletions

View file

@ -3,8 +3,7 @@ import { doRequest } from '../../helpers/requests'
import { logger } from '../../helpers/logger'
import * as Bluebird from 'bluebird'
import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub'
import { checkUrlsSameHost } from '../../helpers/activitypub'
import { parse } from "url"
import { parse } from 'url'
type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>)
type CleanerFunction = (startedDate: Date) => (Promise<any> | Bluebird<any>)

View file

@ -28,7 +28,7 @@ async function buildSignedRequestOptions (payload: Payload) {
actor = await getServerActor()
}
const keyId = actor.getWebfingerUrl()
const keyId = actor.url
return {
algorithm: HTTP_SIGNATURE.ALGORITHM,
authorizationHeaderName: HTTP_SIGNATURE.HEADER_NAME,

View file

@ -74,6 +74,8 @@ async function checkHttpSignature (req: Request, res: Response) {
const verified = isHTTPSignatureVerified(parsed, actor)
if (verified !== true) {
logger.warn('Signature from %s is invalid', actorUrl, { parsed })
res.sendStatus(403)
return false
}