How to get Origin request header in Rails

How to get Origin request header from cross-domain AJAX requests in Rails?

+8
ruby-on-rails cors
source share
1 answer

You can achieve this in the controller using:

request.headers['origin'] 

Note. You will need to make certain changes to certain configuration files for your application in order to be able to respond to a CORS request. I hope you have it covered.

+15
source share

All Articles