Rails 3.2 force_ssl 登陆页面除外 [英] Rails 3.2 force_ssl except on landing page

查看:34
本文介绍了Rails 3.2 force_ssl 登陆页面除外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在除登陆页面之外的所有路由上强制执行 SSL.我尝试在所有控制器中设置 force_ssl,对于包含 root 的控制器,我做了:

I want to enforce SSL on all routes except my landing page. I tried setting force_ssl in all my controllers, and for the controller that contains root, I did:

force_ssl :except => :index

force_ssl :except => :index

但是,在我将其部署到 Heroku 上的登台应用程序后,我的应用程序仍在主页上强制执行 ssl.是否还需要执行其他操作才能在该特定路由上禁用 ssl?

However, after I deployed this to my staging app on Heroku, my app is still enforcing ssl on the home page. Is there something else that needs to be done to disable ssl on that specific route?

推荐答案

rack-ssl-enforcer gem 会帮助你

这篇关于Rails 3.2 force_ssl 登陆页面除外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆