Created
August 15, 2011 09:32
-
-
Save mindscratch/1145957 to your computer and use it in GitHub Desktop.
Rails (3.0.x): request.ssl? isn't working -- monkey patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Application < Rails::Application | |
| # MONKEY PATCH | |
| # | |
| # Calls to request.ssl? aren't working. The ssl? method relies on some environment variable(s) | |
| # to be set and doesn't take into account the 'rack.url_scheme'. See ticket #5750 on the Rails | |
| # lighthouseapp.com ticketing site. | |
| # url: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5750-requestssl-should-reflect-rackurl_scheme | |
| def call(env) | |
| env['HTTPS'] = 'on' if env['rack.url_scheme'] == 'https' | |
| super | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment