Showing the changes to lib (1 of 6 files). Show all
Unified · Split
| @@ -172,6 +172,15 @@ class App < Sinatra::Application · 171 unmodified lines | |||
| 172 | halt erb :unsupported if unsupported_browser? | 172 | halt erb :unsupported if unsupported_browser? |
| 173 | end | 173 | end |
| 174 | 174 | ||
| 175 | OUT_HOST = 'out.devdocs.io'.freeze | ||
| 176 | |||
| 177 | before do | ||
| 178 | if request.host == OUT_HOST && !request.path.start_with?('/s/') | ||
| 179 | query_string = "?#{request.query_string}" unless request.query_string.empty? | ||
| 180 | redirect "http://devdocs.io#{request.path}#{query_string}", 302 | ||
| 181 | end | ||
| 182 | end | ||
| 183 | |||
| 175 | get '/manifest.appcache' do | 184 | get '/manifest.appcache' do |
| 176 | content_type 'text/cache-manifest' | 185 | content_type 'text/cache-manifest' |
| 177 | expires 0, :'no-cache' | 186 | expires 0, :'no-cache' |