Closed hh54188 closed 5 months ago
BTW, I try to replace Hono with Oak and it still not working. It works find in local environment. But the header will miss once it been deployed to the Deno Deploy
Deno Deploy won't change access-control-*
headers if set. The response looks like it was served by CloudFlare? It looks like CloudFlare is serving you a redirect in this case.
Problem description
I build an application with Deno and Hono framework. This is the main code part:
When I try to access the health API from my another website which use port 8080. I can get resposne successfully. Here is the resposne header
However, after I deploy the Deno application on Deno Deploy. The header
access-control-allow-origin
is missing. Here is the resposne header after deployment:Which make my backend service cannnot be accessed from the website
Steps to reproduce
Deploy the service to Deno Deployment
Try to access the
/api/v1/health
from the browser via web pageExpected behavior
The
Access-Control-Allow-Origin
can be seen in the API responseEnvironment
My local environment:
I don't know what's the environment on the Deno Deploy
Possible solution
No response
Additional context
No response