lib/rufus/verbs/endpoint.rb in rufus-verbs-0.3 vs lib/rufus/verbs/endpoint.rb in rufus-verbs-0.4

- old
+ new

@@ -475,12 +475,14 @@ # Once the final response has been hit, will make sure # it's decompressed. # def handle_response (method, res, opts) + nored = o(opts, [ :no_redirections, :noredir ]) + #if res.is_a?(Net::HTTPRedirection) - if [ 301, 303, 307 ].include?(res.code.to_i) + if [ 301, 303, 307 ].include?(res.code.to_i) and (nored != true) maxr = o(opts, :max_redirections) if maxr maxr = maxr - 1 @@ -512,9 +514,11 @@ end opts[:query] = query_to_h opts[:query] return request(method, opts) + # + # following the redirection end decompress res res