( request: Request, env: Env, ctx: ExecutionContext, )
| 4 | |
| 5 | export default { |
| 6 | async fetch( |
| 7 | request: Request, |
| 8 | env: Env, |
| 9 | ctx: ExecutionContext, |
| 10 | ): Promise<Response> { |
| 11 | return await router |
| 12 | .handle(request, env, ctx) |
| 13 | .catch((error_) => { |
| 14 | console.error(error_); |
| 15 | const resp = error(error_); |
| 16 | // Our jsDelivr proxy will fallback to one hour if no cache-control is set |
| 17 | resp.headers.set('Cache-Control', 'max-age=0'); |
| 18 | return resp; |
| 19 | }) |
| 20 | .then(corsify); |
| 21 | }, |
| 22 | }; |
no test coverage detected