Hi, I am having trouble with CORS pre-flight requ...
# support-questions-legacy
m
Hi, I am having trouble with CORS pre-flight request. Getting a
404
response when using a
chi
router. However it works just fine when I use
net/http
. Using this for reference: https://supertokens.com/docs/thirdpartyemailpassword/pre-built-ui/setup/backend#4-add-the-supertokens-apis--cors-setup
n
Hi @mayankgopronto, Can you post the code for SuperTokens init and where you add the cors headers
m
Here's the relevant code.
The frontend is running on
localhost:9000
n
And can you post the full error you get
r
@sattvikc can help here
s
sure
m
There is nothing is the backend logs.
s
is the OPTIONS request returning 404 ?
m
Yes, the
OPTIONS
request returns 404
s
seems like there is some issue with the CORS config. let me check and get back to you
can you confirm which version of chi you are using?
in your code, if you change the chi import to
"github.com/go-chi/chi/v5"
it works fine. Our example also refers to this one.
m
I tried using
chi/v5
as well. Same issue.
2 Views