diff --git a/src/index.ts b/src/index.ts index 1f2a699..84d7cb7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -429,8 +429,10 @@ export class Router { if (!response) return new Response(this.debugMode ? 'Handler did not return a Response!' : null, { status: 404 }) - if (this.corsEnabled) + if (this.corsEnabled) { + response = new Response(response.body, response) this.setCorsHeaders(response.headers) + } return response }