(body: unknown, status = 200)
| 538 | // --------------------------------------------------------------------------- |
| 539 | |
| 540 | const json = (body: unknown, status = 200): Response => |
| 541 | new Response(JSON.stringify(body), { |
| 542 | status, |
| 543 | headers: { 'content-type': 'application/json; charset=utf-8' }, |
| 544 | }); |
| 545 | |
| 546 | /** Constant-time over digests, so neither the length nor a prefix of the token leaks. */ |
| 547 | async function tokenMatches(provided: string, expected: string): Promise<boolean> { |