I'm using the rack-cors gem with Rails: https://github.com/cyu/rack-cors
I need to whitelist ONE domain so that it will allow that domain through.
I would think that this would allow traffic from the whitelisted domain . I am making a POST request from https://reflective-basket.surge.sh/ to my rails app. (domain name modified for the sake of this post on stackoverflow)
However, POST requests will not go through. The destination Rails app says:
The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.
If I remove the protect from forgery
line from the application controller, (protect_from_forgery with: :exception
), of course, the app allows all traffic through but this defeats the purpose of having a secure app.
I'm sure this is a common problem (needing a form on website A submit data to website B but only from a certain domain) but this just doesn't seem to work as I would have hoped. Any pointers? I'm open to making this work in any way that's possible.