Browse Source

Use protocol-relative URLs

Thibaut 10 years ago
parent
commit
5568630fc2
2 changed files with 4 additions and 3 deletions
  1. 1 1
      assets/javascripts/templates/pages/root_tmpl.coffee.erb
  2. 3 2
      lib/app.rb

+ 1 - 1
assets/javascripts/templates/pages/root_tmpl.coffee.erb

@@ -59,7 +59,7 @@ app.templates.intro = """
       <li>DevDocs works <a href="/offline">offline</a>, on mobile, and can be installed on <a href="https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe">Chrome</a> and <a href="https://marketplace.firefox.com/app/devdocs/">Firefox</a>.
       <li>For the latest news, subscribe to the <a href="http://eepurl.com/HnLUz">newsletter</a> or follow <a href="https://twitter.com/DevDocs">@DevDocs</a>
       <li>DevDocs is free and <a href="https://github.com/Thibaut/devdocs">open source</a>
-          <iframe class="_github-btn" src="http://ghbtns.com/github-btn.html?user=Thibaut&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
+          <iframe class="_github-btn" src="//ghbtns.com/github-btn.html?user=Thibaut&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
       <li>If you like the app, please consider supporting the project on <a href="https://gratipay.com/Thibaut/">Gratipay</a>. Thanks!
     </ol>
     <p class="_intro-sponsors">

+ 3 - 2
lib/app.rb

@@ -38,6 +38,7 @@ class App < Sinatra::Application
       config.environment = sprockets
       config.prefix = "/#{assets_prefix}"
       config.public_path = public_folder
+      config.protocol = :relative
     end
   end
 
@@ -57,7 +58,7 @@ class App < Sinatra::Application
 
   configure :production do
     set :static, false
-    set :docs_host, 'http://docs.devdocs.io'
+    set :docs_host, '//docs.devdocs.io'
 
     use Rack::ConditionalGet
     use Rack::ETag
@@ -180,7 +181,7 @@ class App < Sinatra::Application
   end
 
   get '/s/shopify' do
-    redirect 'http://www.shopify.com/careers?utm_source=devdocs&utm_medium=banner&utm_campaign=devdocs'
+    redirect 'https://www.shopify.com/careers?utm_source=devdocs&utm_medium=banner&utm_campaign=devdocs'
   end
 
   get %r{\A/feed(?:\.atom)?\z} do