Skip to content

Fix: CORS headers not being applied to requests#61

Open
rivenintech wants to merge 1 commit intocloudflare:masterfrom
rivenintech:master
Open

Fix: CORS headers not being applied to requests#61
rivenintech wants to merge 1 commit intocloudflare:masterfrom
rivenintech:master

Conversation

@rivenintech
Copy link

Copied from #60, which I accidentally deleted 😅:

This PR fixes an issue where CORS headers were not being applied, due to the wrong order (routes before middleware).

I came across this issue when I tried to fetch the GraphQL endpoint from React.

452617220-92cbf20d-f6d8-4748-8718-77f705537a1e

By moving the middleware above the routes, as it is done in the Hono documentation, we ensure they are applied to all requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant