Fix secure.travis-ci.org redirect
`fullpath` starts with SCRIPT_NAME. From the Rack spec: > The SCRIPT_NAME, if non-empty, must start with / Fixes travis-ci/travis-ci#1278.
This commit is contained in:
parent
76af32013b
commit
73213153fe
|
@ -9,7 +9,7 @@ class RedirectSubdomain < Struct.new(:app, :from)
|
||||||
def call(env)
|
def call(env)
|
||||||
request = Rack::Request.new(env)
|
request = Rack::Request.new(env)
|
||||||
if request.host == from
|
if request.host == from
|
||||||
[301, { 'Location' => "https://travis-ci.org/#{request.fullpath}", 'Content-Type' => 'text/html' }, []]
|
[301, { 'Location' => "https://travis-ci.org#{request.fullpath}", 'Content-Type' => 'text/html' }, []]
|
||||||
else
|
else
|
||||||
app.call(env)
|
app.call(env)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user