class ActionDispatch::Routing::Redirect

def build_response(req)

def build_response(req)
  uri = URI.parse(path(req.path_parameters, req))
  unless uri.host
    if relative_path?(uri.path)
      uri.path = "#{req.script_name}/#{uri.path}"
    elsif uri.path.empty?
      uri.path = req.script_name.empty? ? "/" : req.script_name
    end
  end
  uri.scheme ||= req.scheme
  uri.host   ||= req.host
  uri.port   ||= req.port unless req.standard_port?
  req.commit_flash
  body = ""
  headers = {
    "Location" => uri.to_s,
    "Content-Type" => "text/html; charset=#{ActionDispatch::Response.default_charset}",
    "Content-Length" => body.length.to_s
  }
  ActionDispatch::Response.new(status, headers, body)
end