Refactor merb redirect following

This commit is contained in:
Bryan Helmkamp 2008-11-07 11:35:53 -05:00
parent ff3e869776
commit 5766ccf60f
1 changed files with 3 additions and 2 deletions

View File

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