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. // Only enough here for what I need.
declare module "activitypub-http-signatures" { declare module "activitypub-http-signatures" {
export class Sha256Signer { 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; 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({ const signer = new Sha256Signer({
privateKey: signedInit.privateKey, privateKey: signedInit.privateKey,
publicKeyId: signedInit.keyId publicKeyId: signedInit.keyId,
}, headerNames); headerNames
});
const signature = signer.sign({ const signature = signer.sign({
url, url,