(body: string, init: ResponseInit & { nonce?: string } = {})
| 74 | } |
| 75 | |
| 76 | function html(body: string, init: ResponseInit & { nonce?: string } = {}): Response { |
| 77 | const { nonce, headers, ...rest } = init; |
| 78 | return withSecurityHeaders( |
| 79 | new Response(body, { |
| 80 | ...rest, |
| 81 | headers: headersWith( |
| 82 | { |
| 83 | 'content-type': 'text/html; charset=utf-8', |
| 84 | // Never let a page render from cache after sign-out. |
| 85 | 'cache-control': 'no-store', |
| 86 | }, |
| 87 | headers, |
| 88 | ), |
| 89 | }), |
| 90 | nonce, |
| 91 | ); |
| 92 | } |
| 93 | |
| 94 | function json(body: unknown, init: ResponseInit = {}): Response { |
| 95 | const { headers, ...rest } = init; |
no test coverage detected