mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Fix handling of 304 No Content responses
This patch retains the previous behavior of treating all 3xx responses as redirected _except_ 304. It may be sensible to review and remove some status codes from auto-redirect handling such as 300 Multiple Choice.
This commit is contained in:
parent
dc14b30c78
commit
0f606b2402
1 changed files with 6 additions and 1 deletions
|
@ -135,7 +135,12 @@ module HTTParty
|
|||
# Raises exception Net::XXX (http error code) if an http error occured
|
||||
def handle_response(response)
|
||||
case response
|
||||
when Net::HTTPRedirection
|
||||
when Net::HTTPMultipleChoice, # 300
|
||||
Net::HTTPMovedPermanently, # 301
|
||||
Net::HTTPFound, # 302
|
||||
Net::HTTPSeeOther, # 303
|
||||
Net::HTTPUseProxy, # 305
|
||||
Net::HTTPTemporaryRedirect
|
||||
options[:limit] -= 1
|
||||
self.path = response['location']
|
||||
@redirect = true
|
||||
|
|
Loading…
Add table
Reference in a new issue