Refactor merb redirect following

This commit is contained in:
Bryan Helmkamp 2008-11-07 11:35:53 -05:00
parent ff3e869776
commit 5766ccf60f

View File

@ -40,8 +40,9 @@ module Webrat
def do_request(url, data, headers, method) def do_request(url, data, headers, method)
@response = request(url, @response = request(url,
:params => (data && data.any?) ? data : nil, :params => (data && data.any?) ? data : nil,
:headers => headers, :method => method) :headers => headers,
self.get(@response.headers['Location'], nil, @response.headers) if @response.status == 302 :method => method)
follow_redirect
end end
def follow_redirect def follow_redirect