Skip to content

Commit

Permalink
fix(federation): 🐛 Hopefully fix the Great Signature Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed May 24, 2024
1 parent 75043ba commit 241ad82
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions server/api/users/:uuid/inbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,17 @@ export default (app: Hono) =>

const isValid = await validator
.validate(
signature,
new Date(Date.parse(date)),
context.req.method as HttpVerb,
reqUrl,
await context.req.text(),
new Request(reqUrl, {
method: context.req.method,
headers: {
Signature: signature,
Date: date,
},
body: await context.req.text(),
}),
)
.catch((e) => {
dualLogger.logError(
new LogManager(Bun.stdout).logError(
LogLevel.ERROR,
"Inbox.Signature",
e as Error,
Expand Down

0 comments on commit 241ad82

Please sign in to comment.