Force SSL for specific routes in Rails 3.1

后端 未结 3 1022
[愿得一人]
[愿得一人] 2021-02-20 04:32

I need to force SSL on all routes in my application except for landing#index.

In config/application.rb, I have:



        
3条回答
  •  执笔经年
    2021-02-20 05:18

    I asked a similar question on stackoverflow here and was told to use https://github.com/tobmatth/rack-ssl-enforcer. I haven't tried it out yet, but based on the readme, it appears to solve your problem of conditionally enforcing ssl on certain routes.

提交回复
热议问题