From 37b115538393f075c80240b7d614f5b612b21b14 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 7 Jan 2015 17:55:56 +0100 Subject: [PATCH] Redirect to https also on staging --- config.ru | 1 + lib/travis/web/app.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.ru b/config.ru index 24b0f492..dbeeaed9 100644 --- a/config.ru +++ b/config.ru @@ -4,6 +4,7 @@ ENV['RAILS_ENV'] = ENV['RACK_ENV'] $: << 'lib' require 'travis/web' +require 'rack-ssl' class RedirectSubdomain < Struct.new(:app, :from) def call(env) diff --git a/lib/travis/web/app.rb b/lib/travis/web/app.rb index 31b436d0..f440670f 100644 --- a/lib/travis/web/app.rb +++ b/lib/travis/web/app.rb @@ -32,7 +32,8 @@ class Travis::Web::App def build(options = {}) builder = Rack::Builder.new - if options[:environment] == 'production' + if options[:environment] == 'production' || + options[:environment] == 'staging' builder.use Rack::SSL, hsts: Travis.config.ssl.hsts end builder.use Rack::Deflater