uri_fetcher.rb revision cf44a17768d43920e482d2a7323f20a2c09ec6ae
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase def fetch_uri_content(uri, limit: 10, write_file: nil, prev_resp: nil)
c53b52986e31858575023886cdd7327fccd8949cTim Reddehase raise TooManyRedirectionsError.new(last_response: prev_resp) if limit == 0
d9f8c4120bb7409b56e1ca212c23ff1428516348Tim Reddehase Net::HTTP.get_response(URI(uri)) do |response|
14446ef4d8181bc484358d51cd08c4ad6353bb2eTim Reddehase elsif response['location'] && !response['location'].empty?
3554937a935585f1c6aea3e25895036cf3f74759Tim Reddehase limit: limit-1,
14446ef4d8181bc484358d51cd08c4ad6353bb2eTim Reddehase raise UnfollowableResponseError.new(last_response: response)
3554937a935585f1c6aea3e25895036cf3f74759Tim Reddehase def produce_response_body(response, write_file=nil)