Skip to content

Commit

Permalink
Fixes for HTTPS.
Browse files Browse the repository at this point in the history
  • Loading branch information
paneq committed Jul 4, 2009
1 parent 0dcc830 commit 1fba947
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/controllers/application_controller.rb
Expand Up @@ -20,6 +20,14 @@ class ApplicationController < ActionController::Base

protected


def ssl_required?
SSL_REQUIRED
end

def ssl_allowed?
SSL_ALLOWED
end

def extract_form_id
params[:form_id]
Expand Down
2 changes: 2 additions & 0 deletions config/environment.rb
Expand Up @@ -25,6 +25,8 @@
APP_DOMAIN = config.app_domain
APP_NAME = config.app_name
APP_EMAIL = config.app_email
SSL_REQUIRED = config.ssl_required == "true"
SSL_ALLOWED = config.ssl_allowed == "true"

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down
4 changes: 3 additions & 1 deletion config/preinitializer.rb
Expand Up @@ -8,7 +8,9 @@ module FileSiteKeys
:rest_auth_digest_stretches,
:app_domain,
:app_name,
:app_email
:app_email,
:ssl_allowed,
:ssl_required
]

ATTRIBUTES.freeze
Expand Down
10 changes: 9 additions & 1 deletion config/site_keys_example.yml
Expand Up @@ -8,6 +8,8 @@ development:
app_domain: localhost:3000
app_name: Manage My Money
app_email: example@example.org
ssl_required: false
ssl_allowed: false

test:
session_key: 3m_session_test
Expand All @@ -19,6 +21,8 @@ test:
app_domain: example.org
app_name: Manage My Money
app_email: example@example.org
ssl_required: false
ssl_allowed: false

selenium:
session_key: 3m_session_selenium
Expand All @@ -30,6 +34,8 @@ selenium:
app_domain: localhost:7000
app_name: Manage My Money
app_email: example@example.org
ssl_required: false
ssl_allowed: false

production:
#read environment.rb
Expand All @@ -43,4 +49,6 @@ production:
rest_auth_digest_stretches: 10
app_domain: example.org
app_name: Manage My Money
app_email: example@example.org
app_email: example@example.org
ssl_required: false
ssl_allowed: false

0 comments on commit 1fba947

Please sign in to comment.