Fix pleroma follow

pull/1787/head
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
}