What problem does this solve?
tryCanonicalForm in src/verify/headers.ts gained a Uint8Array input path in #30, but tests/verify/headers.test.ts only has 3 tests and none pass a Uint8Array directly. The path is exercised indirectly by the Stripe and GitHub verifier tests, but a direct unit test would catch regressions faster.
What would the ideal solution look like?
Add test cases to tests/verify/headers.test.ts:
tryCanonicalForm with a Uint8Array containing valid JSON
tryCanonicalForm with a Uint8Array containing non-UTF-8 bytes (should return null)
tryCanonicalForm with a Uint8Array containing non-JSON text
What problem does this solve?
tryCanonicalForminsrc/verify/headers.tsgained a Uint8Array input path in #30, buttests/verify/headers.test.tsonly has 3 tests and none pass a Uint8Array directly. The path is exercised indirectly by the Stripe and GitHub verifier tests, but a direct unit test would catch regressions faster.What would the ideal solution look like?
Add test cases to
tests/verify/headers.test.ts:tryCanonicalFormwith a Uint8Array containing valid JSONtryCanonicalFormwith a Uint8Array containing non-UTF-8 bytes (should return null)tryCanonicalFormwith a Uint8Array containing non-JSON text