diff --git a/Gemfile b/Gemfile index 42a42c3dc..f2d252018 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ gem 'omniauth-meetup' gem 'gravatar_image_tag' gem 'simple_form' gem 'sentry-raven' +gem 'rack-canonical-host' group :production do gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index da740f007..80ddc6a54 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -201,6 +201,9 @@ GEM rack (1.4.5) rack-cache (1.2) rack (>= 0.4) + rack-canonical-host (0.0.8) + addressable + rack (~> 1.0) rack-ssl (1.3.3) rack rack-test (0.6.2) @@ -347,6 +350,7 @@ DEPENDENCIES pg poltergeist quiet_assets + rack-canonical-host rails (= 3.2.14) rails_12factor rb-fsevent diff --git a/config.ru b/config.ru index 841e751a8..13afcfa54 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,5 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) +use Rack::CanonicalHost, ENV['CANONICAL_HOST'] if ENV['CANONICAL_HOST'] run Bridgetroll::Application