Closed piotr-yuxuan closed 6 years ago
HI @piotr-yuxuan re-frame-http-fx is a very thin wrapper over cljs-ajax. I took a quick look at our code and couldn't see anything obviously wrong here. I think what's happening is you need to provide an accepted content-type which is text/html. The GNU website is trying to do content negotiation, but your XHR request doesn't provide a content-type that it accepts. The CORS error is a bit of a red herring (I think), the real problem is the error page, which then blows up into a CORS error as the error page doesn't serve your CORS headers.
Closing because this was more a question than an actual issue.
First, thanks for that piece of code. It's well designed and a very handy re-frame effectful effect :-)
However, I've just run into a behaviour I can't explain neither avoid when querying some URL. I've got a minimal (non-)working example to explain stuff rigorously and I describe it in the README.md.
If the error lies on my side and not in your code's (as it's very likely to be) perhaps it would be worth adding a small explanation in your README.md: code needed to reproduce this behaviour is rather simple and I guess a lot of newbie (as I am) would stumble upon this pitfall.