Unverified Commit 0010f161 authored by Hong Minhee's avatar Hong Minhee
Browse files

Fix timestamp precision in RFC 9421 signatures

Ensure timestamp is truncated to integer seconds to comply with RFC 9421
specification requirements.
parent d1f7ddee
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -406,8 +406,8 @@ async function signRequestRfc9421(
  }

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

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