Created
April 17, 2012 02:26
-
-
Save stephensprinkle-zz/2403002 to your computer and use it in GitHub Desktop.
Test for SSL + Subdomain in Production Rails Controller
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
before_filter :secure_subdomain_ssl | |
private | |
def secure_subdomain_ssl | |
if Rails.env.production? | |
if request.subdomain != 'secure' or request.ssl? != true | |
redirect_to :subdomain => 'secure', :protocol => 'https' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment