This commit is contained in:
syuilo 2018-04-15 12:51:05 +09:00
parent 82c93fdcb8
commit eebd5f62b3
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import * as kue from 'kue';
import * as debug from 'debug';
import { verifySignature } from 'http-signature';
const httpSignature = require('http-signature');
import parseAcct from '../../../acct/parse';
import User, { IRemoteUser } from '../../../models/user';
import perform from '../../../remote/activitypub/perform';
@ -50,7 +50,7 @@ export default async (job: kue.Job, done): Promise<void> => {
return;
}
if (!verifySignature(signature, user.publicKey.publicKeyPem)) {
if (!httpSignature.verifySignature(signature, user.publicKey.publicKeyPem)) {
console.warn('signature verification failed');
done();
return;

View File

@ -1,6 +1,6 @@
import * as Router from 'koa-router';
const koaBody = require('koa-body');
const parseRequest = require('http-signature');
const httpSignature = require('http-signature');
import { createHttp } from '../queue';
import pack from '../remote/activitypub/renderer';
@ -25,7 +25,7 @@ router.post('/users/:user/inbox', koaBody(), ctx => {
ctx.req.headers.authorization = 'Signature ' + ctx.req.headers.signature;
try {
signature = parseRequest(ctx.req);
signature = httpSignature.parseRequest(ctx.req);
} catch (e) {
ctx.status = 401;
return;