8 months ago
I set up hono backend with cors setitng to allow all origin, but somehow when I accessed the server with the domain set, it keeps returning cors error with 200 response.
0 Replies
8 months ago
send the domain in question please
I set with railway, and other project such as 4c028fe8-0273-420a-84cc-be5ea253616c works fine without extra configuration
8 months ago
have you verified that the cors headers are being set?
8 months ago
check the headers returned
8 months ago
where can I see this error for myself
I run a web app in localhost
8 months ago
I'm sorry but that doesn't really answer my question
I recently switched the server url to be this test-cors.standardweb3.com
I do not understand. the header already has Access-Control-Allow-Origin property
8 months ago
^
8 months ago
it looks like you already run it on vercel?
8 months ago
yes
no, this error is from localhost
8 months ago
look at the image in the root post, that's vercel
8 months ago
and what do i do to see the cors error?
8 months ago
im sorry but thats outside of what id like to do
8 months ago
i need an easy way to see the cors error for myself
curl -X POST https://test-cors.standardweb3.com/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ hello }"}'
curl -X POST https://test-cors.standardweb3.com \
-H "Content-Type: application/json" \
-d '{
"query": "query GetTradeHistorysCursor($maker: String!, $after: String, $limit: Int) { account(id: $maker) { totalTradeHistory tradeHistory(orderBy: \"timestamp\", orderDirection: \"desc\", after: $after, limit: $limit) { pageInfo { startCursor hasPreviousPage hasNextPage endCursor } } } }",
"variables": {
"maker": "0xF8FB4672170607C95663f4Cc674dDb1386b7CfE0",
"limit": 10
}
}'
8 months ago
there are no cors headers
8 months ago
8 months ago
right but thats irrelevant
that is weird, prefetch had header configured from the hono code, then why is it missing?
8 months ago
i dont know, you would need to consult their docs
8 months ago
curl does not care about cors, cors is for browsers
8 months ago
^
I don't know what is happening, but the file in that deployment works well without cors issue
8 months ago
this is an application level issue
if this is an application level issue, why is cors working in the current rollback deployment of 4c028fe8-0273-420a-84cc-be5ea253616c
8 months ago
because it worked then and your latest code broke something
8 months ago
either way, this is not a platform issue
I disagree, all the working code is same with branch from main in the github standard-ponder repo
8 months ago
if we broke cors for our users applications we would be seeing hundreds of reports pour in
this project also uses the same code from the main branch of the github repo standard-ponder
8 months ago
I'm sorry but this is an application level issue
ok but I don't really understand why only the recent deployment with the same code is causing a problem
8 months ago
to be honest, I don't either, I don't know enough about your code to tell you the issue unfortunately, but that doesn't change my previous statement
8 months ago
i wish you the best of luck while you debug this issue with your app
8 months ago
what was the error?
8 months ago
strange, glad you found a fix