Fork me on GitHub
#lein-figwheel
<
2017-05-30
>
avg21:05:34

Hello, guys! Posted this in #figwheel channel, but seems it makes more sense to place it here. I have a problem with figwheel dev server CORS. It should be a ubiquitous problem, but I can't find a ready solution. I'm developing front-end with reagent/re-frame and I have java spring back-end developed by another person. So when I'm trying to send any requests to the server-side, I got 401 on OPTIONS request. A possible way to solve CORS problem is to set 'Access-Control-Allow-Origin: *' header, but it's insecure. So I want to deal with dev server itself. As I understand, I need something like a proxy, that will modify 'Origin' header of all requests made from UI to server-side, setting acceptable header value. Does it make sense? Anyway, could you please share practices you use and forward me to the right direction? Thank you! PS: maybe it just makes sense to enable CORS on the server-side in dev mode and disable in production...

danielcompton23:05:14

> A possible way to solve CORS problem is to set 'Access-Control-Allow-Origin: *' header, but it's insecure. This is fine in dev

danielcompton23:05:34

You could use a proxy, but there are headers designed to solve this exact problem