How to get “Origin” request header in Rails

怎甘沉沦 提交于 2020-12-30 05:22:37

问题


How do I get the Origin request header from cross-domain AJAX requests in Rails?


回答1:


You can achieve this in the controller by using:

request.headers['origin']

Note: You will need to make certain changes in certain config files for your application to be able to respond to a CORS request. Hope you've got that covered.



来源:https://stackoverflow.com/questions/22812477/how-to-get-origin-request-header-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!