CORS Requests + Responses #2040
Unanswered
gxxcastillo
asked this question in
Q&A
Replies: 1 comment
-
Hi, @gxxcastillo. What you are doing looks correct to me. You can use http.options('*', () => {
return new Response(null, {
status: 200,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE',
'Access-Control-Allow-Headers': '*',
},
})
})
Can you please share those errors? Where are they coming from? What do they state? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When running my integration tests, which use MSW for mocking api requests, I'm noticing "OPTIONS" pre-flight requests are being made.
What's the recommended approach for dealing with these CORS requests?
I've gone about adding the following handler:
However, I'm still getting Network Errors. Is there something I need to do for the MSW server to handle CORS requests?
Beta Was this translation helpful? Give feedback.
All reactions