From e80fdbfaf2cc07df94cf721ab6a9e5921671f56e Mon Sep 17 00:00:00 2001 From: Moon Man Date: Sun, 31 Dec 2023 05:36:13 -0500 Subject: [PATCH] woops put headernames in wrong place --- module.d.ts | 2 +- src/net.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module.d.ts b/module.d.ts index 5a0ce17..f906b0b 100644 --- a/module.d.ts +++ b/module.d.ts @@ -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; }; diff --git a/src/net.ts b/src/net.ts index f5b6e36..b11d5a0 100644 --- a/src/net.ts +++ b/src/net.ts @@ -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,