I finally understood the main problem. The CORS er...
# help
a
I finally understood the main problem. The CORS error says that even in the preflight request we are getting
Access-Control-Allow-Origin: *
, but there is a different value there.
Copy code
allowOrigins: [
          "<http://localhost:3000>",
          "<https://domain1>",
          "<https://dev.domain1>",
        ],
@Frank This is the only problem that prevents our successful deployment
f
I see.. are you hardcoding both
<https://domain1>
and
<https://dev.domain1>
?
a
Yes, but why do I get the same
*
on localhost as well?
First of all, it doesn't work locally
f
@Artemiy Davydov I create a sample repo to gave this a try https://github.com/fwang/sst-triage-cors
It’s a very simple app with 1 Api. The cors is configured like this https://github.com/fwang/sst-triage-cors/blob/main/stacks/MyStack.js#L9-L14
And I ran a test from https://resttesttest.com/
The
access-control-allow-origin
seems to be set correctly in the response header.
This is the correct behavior you were expecting to see right?