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 | e778f2c1214e3f8238e63380f8f7e75f236d5223 (patch) | |
| tree | 9e0fdd85f47b2191cbb4c52f3238bf6de06bfdd5 /lib/custodian/protocoltest | |
| parent | 763aeecb686c59d9f8e25ddfacd43a0f2ed4881d (diff) | |
  Updated to max 10 redirections; and handle excessive redirections cleanly.
Diffstat (limited to 'lib/custodian/protocoltest')
| -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 | 
