Open zendevil opened 4 years ago
Any chance you're calling clj-http.client from a Clojure context (instead of ClojureScript)? AFAIK, clj-http only works in Clojure, so it's running server-side, where there is no CORS restrictions, only the browser requests has to follow the rules of CORS.
I make a request like so using clj-http.client
and get a response with status 200.
However, when I make the same request with cljs-http.client like so:
I get a response with status 0, and in the browser it says that it's been blocked by the cors policy.
Why would the cljs-http.client request be blocked by the cors policy if the clj-http.client request isn't? I have manually set the headers in ring like so:
I wrap my response for route "bar" with the function response above.