Skip to content

Commit

Permalink
Only resend 303 redirects when specifically asked to by resend_on_red…
Browse files Browse the repository at this point in the history
…irect
  • Loading branch information
madumlao committed Jul 31, 2014
1 parent f902a7f commit 5ea13dc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/httparty/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,15 @@ def handle_response(body, &block)
end
self.path = last_response['location']
self.redirect = true
self.http_method = Net::HTTP::Get unless options[:maintain_method_across_redirects]
if last_response.class == Net::HTTPSeeOther
unless options[:maintain_method_across_redirects] and options[:resend_on_redirect]
self.http_method = Net::HTTP::Get
end
else
unless options[:maintain_method_across_redirects]
self.http_method = Net::HTTP::Get
end
end
capture_cookies(last_response)
perform(&block)
else
Expand Down

0 comments on commit 5ea13dc

Please sign in to comment.