From 77cfe0a354f327643db7b9f831a0255721d4f8ac 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') 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