woops put headernames in wrong place

This commit is contained in:
Moon Man 2023-12-31 05:36:13 -05:00
parent 6ada10a340
commit e80fdbfaf2
2 changed files with 4 additions and 3 deletions

2
module.d.ts vendored
View File

@ -6,7 +6,7 @@ declare module "activitypub-express" {
// Only enough here for what I need.
declare module "activitypub-http-signatures" {
export class Sha256Signer {
constructor(options: { publicKeyId: string, privateKey: string }, headerNames?: string[]);
constructor(options: { publicKeyId: string, privateKey: string, headerNames?: string[] });
sign: (options: { url: string, method: string, headers: any[] }) => string;
};

View File

@ -45,8 +45,9 @@ export const signedFetch = async (url: string, init: RequestInit, signedInit: Si
const signer = new Sha256Signer({
privateKey: signedInit.privateKey,
publicKeyId: signedInit.keyId
}, headerNames);
publicKeyId: signedInit.keyId,
headerNames
});
const signature = signer.sign({
url,