Redirect to https also on staging
This commit is contained in:
parent
7e3e056e1c
commit
37b1155383
|
@ -4,6 +4,7 @@ ENV['RAILS_ENV'] = ENV['RACK_ENV']
|
||||||
|
|
||||||
$: << 'lib'
|
$: << 'lib'
|
||||||
require 'travis/web'
|
require 'travis/web'
|
||||||
|
require 'rack-ssl'
|
||||||
|
|
||||||
class RedirectSubdomain < Struct.new(:app, :from)
|
class RedirectSubdomain < Struct.new(:app, :from)
|
||||||
def call(env)
|
def call(env)
|
||||||
|
|
|
@ -32,7 +32,8 @@ class Travis::Web::App
|
||||||
|
|
||||||
def build(options = {})
|
def build(options = {})
|
||||||
builder = Rack::Builder.new
|
builder = Rack::Builder.new
|
||||||
if options[:environment] == 'production'
|
if options[:environment] == 'production' ||
|
||||||
|
options[:environment] == 'staging'
|
||||||
builder.use Rack::SSL, hsts: Travis.config.ssl.hsts
|
builder.use Rack::SSL, hsts: Travis.config.ssl.hsts
|
||||||
end
|
end
|
||||||
builder.use Rack::Deflater
|
builder.use Rack::Deflater
|
||||||
|
|
Loading…
Reference in New Issue
Block a user