(body: unknown, init: ResponseInit = {})
| 92 | } |
| 93 | |
| 94 | function json(body: unknown, init: ResponseInit = {}): Response { |
| 95 | const { headers, ...rest } = init; |
| 96 | return withSecurityHeaders( |
| 97 | new Response(JSON.stringify(body), { |
| 98 | ...rest, |
| 99 | headers: headersWith( |
| 100 | { |
| 101 | 'content-type': 'application/json; charset=utf-8', |
| 102 | 'cache-control': 'no-store', |
| 103 | }, |
| 104 | headers, |
| 105 | ), |
| 106 | }), |
| 107 | ); |
| 108 | } |
| 109 | |
| 110 | function redirect(location: string, init: ResponseInit = {}): Response { |
| 111 | const { headers, status, ...rest } = init; |
no test coverage detected