mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-27 08:23:02 +00:00
Fix bug
This commit is contained in:
parent
82c93fdcb8
commit
eebd5f62b3
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
import * as kue from 'kue';
|
import * as kue from 'kue';
|
||||||
import * as debug from 'debug';
|
import * as debug from 'debug';
|
||||||
|
|
||||||
import { verifySignature } from 'http-signature';
|
const httpSignature = require('http-signature');
|
||||||
import parseAcct from '../../../acct/parse';
|
import parseAcct from '../../../acct/parse';
|
||||||
import User, { IRemoteUser } from '../../../models/user';
|
import User, { IRemoteUser } from '../../../models/user';
|
||||||
import perform from '../../../remote/activitypub/perform';
|
import perform from '../../../remote/activitypub/perform';
|
||||||
|
@ -50,7 +50,7 @@ export default async (job: kue.Job, done): Promise<void> => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!verifySignature(signature, user.publicKey.publicKeyPem)) {
|
if (!httpSignature.verifySignature(signature, user.publicKey.publicKeyPem)) {
|
||||||
console.warn('signature verification failed');
|
console.warn('signature verification failed');
|
||||||
done();
|
done();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as Router from 'koa-router';
|
import * as Router from 'koa-router';
|
||||||
const koaBody = require('koa-body');
|
const koaBody = require('koa-body');
|
||||||
const parseRequest = require('http-signature');
|
const httpSignature = require('http-signature');
|
||||||
|
|
||||||
import { createHttp } from '../queue';
|
import { createHttp } from '../queue';
|
||||||
import pack from '../remote/activitypub/renderer';
|
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;
|
ctx.req.headers.authorization = 'Signature ' + ctx.req.headers.signature;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
signature = parseRequest(ctx.req);
|
signature = httpSignature.parseRequest(ctx.req);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ctx.status = 401;
|
ctx.status = 401;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue