diff --git a/config.ru b/config.ru
index bb685ce3..c9b94c7c 100644
--- a/config.ru
+++ b/config.ru
@@ -64,4 +64,5 @@ run Travis::Web::App.build(
pro: ENV['TRAVIS_PRO'],
code_climate: ENV['CODE_CLIMATE'],
code_climate_url: ENV['CODE_CLIMATE_URL'],
+ assets_host: ENV['ASSETS_HOST']
)
diff --git a/lib/travis/web/app.rb b/lib/travis/web/app.rb
index 2f969c39..037298b1 100644
--- a/lib/travis/web/app.rb
+++ b/lib/travis/web/app.rb
@@ -94,7 +94,6 @@ class Travis::Web::App
else
set_config(content, options) if config_needed?(file)
set_title(content) if index?(file)
- set_assets_host(content) if index?(file)
headers = {
'Content-Length' => content.bytesize.to_s,
@@ -169,7 +168,14 @@ class Travis::Web::App
end
string.gsub! %r{(src|href)="(?:\/?)((styles|scripts)\/[^"]*)"} do
- %(#{$1}=#{opts[:alt] ? "#{S3_URL}/#{opts[:alt]}/#{$2}":"/#{$2}"})
+ src = if options[:assets_host]
+ "#{options[:assets_host].chomp('/')}/#{$2}"
+ elsif opts[:alt]
+ "#{S3_URL}/#{opts[:alt]}/#{$2}"
+ else
+ "/#{$2}"
+ end
+ %(#{$1}="#{src}")
end
end
end
diff --git a/public/index.html b/public/index.html
index f15c5cb7..673b0ae0 100644
--- a/public/index.html
+++ b/public/index.html
@@ -23,8 +23,8 @@
-
-
+
+