Skip to content

Commit 0010f16

Browse files
committed
Fix timestamp precision in RFC 9421 signatures
Ensure timestamp is truncated to integer seconds to comply with RFC 9421 specification requirements.
1 parent d1f7dde commit 0010f16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fedify/sig/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ async function signRequestRfc9421(
406406
}
407407

408408
// Use provided timestamp or current time
409-
const created = (currentTime ?? Temporal.Now.instant()).epochMilliseconds /
410-
1000;
409+
const created = ((currentTime ?? Temporal.Now.instant()).epochMilliseconds /
410+
1000) | 0; // Convert to seconds and truncate to integer
411411

412412
// Define components to include in the signature
413413
const components = [

0 commit comments

Comments
 (0)