ring

Spaceman 2020-04-21T22:39:59.034600Z

I have yet another cors issue:

Access to XMLHttpRequest at '<http://localhost:3000/fetch-categories>' from origin '<http://localhost:3689>' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
So it's a cors error, and I follow the instruction and set the credentials to false:
{"Content-Type" "application/edn"
             "Access-Control-Allow-Headers" "Content-Type"
             "Access-Control-Allow-Origin" "*"
             "Access-Control-Request-Method" "GET, OPTIONS"
             "Access-Control-Allow-Credentials" false}
But still getting the same error. Fixes?

seancorfield 2020-04-21T22:45:28.035Z

@pshar10 It wants you to fix the request not the response.

seancorfield 2020-04-21T22:50:22.035900Z

Ah, further reading suggests that you can't provide "Access-Control-Allow-Credentials" false -- you must omit the header completely. Only a true value is permitted if the header is present.

seancorfield 2020-04-21T22:51:08.036700Z

(I was initially thinking you could change the request to opt out of credentials but reading more on that has just confused me 🙂 )

Spaceman 2020-04-21T22:54:14.037500Z

That solved credentials. But what about the new error? Access to XMLHttpRequest at 'http://localhost:3000/fetch-categories' from origin 'http://localhost:3689' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.

seancorfield 2020-04-21T23:07:52.037800Z

That's the same error you posted above.

seancorfield 2020-04-21T23:09:02.038800Z

That's what I was responding to. Either you need to change the request (so credentials mode is not 'include') or change the headers you send back (to omit the allow credentials one).