From 2a61ca1b194157a41aeae4c6540c92fed0e45676 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Fri, 14 Dec 2012 16:11:00 +0100 Subject: [PATCH] fix redirect --- config.ru | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config.ru b/config.ru index 39bdb979..1321c07d 100644 --- a/config.ru +++ b/config.ru @@ -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