1
0

fix cors edge case

This commit is contained in:
2023-02-21 15:45:12 +01:00
parent db22422968
commit 3a955af1bc

View File

@@ -429,8 +429,10 @@ export class Router<TEnv = any, TExt = any> {
if (!response) if (!response)
return new Response(this.debugMode ? 'Handler did not return a Response!' : null, { status: 404 }) 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) this.setCorsHeaders(response.headers)
}
return response return response
} }