From e778f2c1214e3f8238e63380f8f7e75f236d5223 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Sat, 24 Nov 2012 15:14:25 +0000 Subject: Updated to max 10 redirections; and handle excessive redirections cleanly. --- lib/custodian/protocoltest/http.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/custodian/protocoltest') diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb index ad9e88d..18fb694 100644 --- a/lib/custodian/protocoltest/http.rb +++ b/lib/custodian/protocoltest/http.rb @@ -125,7 +125,7 @@ module Custodian begin c = Curl::Easy.new(@url) c.follow_location = true - c.max_redirects = 5 + c.max_redirects = 10 c.timeout = 20 c.perform @status = c.response_code @@ -136,6 +136,9 @@ module Custodian rescue Curl::Err::TimeoutError @error = "Timed out fetching page." return false + rescue Curl::Err::TooManyRedirectsError + @error = "Too many redirections (more than 10)" + return false rescue => x @error = "Exception: #{x}" return false -- cgit v1.2.1