mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
Fix bug
This commit is contained in:
parent
a8c3e7038a
commit
1c2aaec303
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user