diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-24 15:14:25 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-24 15:14:25 +0000 |
commit | 77cfe0a354f327643db7b9f831a0255721d4f8ac (patch) | |
tree | 9e0fdd85f47b2191cbb4c52f3238bf6de06bfdd5 | |
parent | 1e214747806edf02f50d5a2a7d1685fba1f59cb4 (diff) |
Updated to max 10 redirections; and handle excessive redirections cleanly.
-rw-r--r-- | lib/custodian/protocoltest/http.rb | 5 |
1 files changed, 4 insertions, 1 deletions
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 |