diff --git a/src/queue/processors/http/process-inbox.ts b/src/queue/processors/http/process-inbox.ts index 75ff5918f6..dfafe64a78 100644 --- a/src/queue/processors/http/process-inbox.ts +++ b/src/queue/processors/http/process-inbox.ts @@ -33,6 +33,11 @@ export default async (job: kue.Job, done): Promise => { } user = await User.findOne({ usernameLower: username, host: host.toLowerCase() }) as IRemoteUser; + + // アクティビティを送信してきたユーザーがまだMisskeyサーバーに登録されていなかったら登録する + if (user === null) { + user = await resolvePerson(activity.actor); + } } else { user = await User.findOne({ host: { $ne: null }, diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts index 85f43eb91d..e6861fdb3e 100644 --- a/src/remote/activitypub/request.ts +++ b/src/remote/activitypub/request.ts @@ -40,5 +40,10 @@ export default (user: ILocalUser, url: string, object) => new Promise((resolve, keyId: `acct:${user.username}@${config.host}` }); + // Signature: Signature ... => Signature: ... + let sig = req.getHeader('Signature').toString(); + sig = sig.replace(/^Signature /, ''); + req.setHeader('Signature', sig); + req.end(JSON.stringify(object)); });