Permalink
Browse files

fix redirect

  • Loading branch information...
1 parent b2f3a36 commit 2a61ca1b194157a41aeae4c6540c92fed0e45676 @svenfuchs svenfuchs committed Dec 14, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 config.ru
View
@@ -7,8 +7,9 @@ require 'travis/web'
class RedirectSubdomain < Struct.new(:app, :from)
def call(env)
- if Rack::Request.new(env).host == from
- [301, { 'Location' => 'https://travis-ci.org', 'Content-Type' => 'text/html' }, []]
+ request = Rack::Request.new(env)
+ if request.host == from
+ [301, { 'Location' => "https://travis-ci.org/#{request.fullpath}", 'Content-Type' => 'text/html' }, []]
else
app.call(env)
end

0 comments on commit 2a61ca1

Please sign in to comment.