Skip to content

Commit 5e5b73c

Browse files
committed
Add algorithm param to Signature header
1 parent c5893c1 commit 5e5b73c

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ To be released.
5555
- Deprecated `VerifyOptions` interface. Use `VerifyRequestOptions`
5656
instead.
5757

58+
- When signing an HTTP request, the `algorithm` parameter is now added to
59+
the `Signature` header. This change improves the compatibility with
60+
Misskey and other implementations that require the `algorithm` parameter.
61+
5862
- Added more log messages using the [LogTape] library. Currently the below
5963
logger categories are used:
6064

cli/inbox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const command = new Command()
9595
{ handle: "i" },
9696
actor,
9797
new Follow({
98+
id: new URL(`#follows/${actor.id?.href}`, fedCtx.getActorUri("i")),
9899
actor: fedCtx.getActorUri("i"),
99100
object: actor.id,
100101
}),

sig/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function signRequest(
5353
privateKey,
5454
new TextEncoder().encode(message),
5555
);
56-
const sigHeader = `keyId="${keyId.href}",headers="${
56+
const sigHeader = `keyId="${keyId.href}",algorithm="rsa-sha256",headers="${
5757
headerNames.join(" ")
5858
}",signature="${encodeBase64(signature)}"`;
5959
headers.set("Signature", sigHeader);

0 commit comments

Comments
 (0)