diff options
Diffstat (limited to 'lib/custodian/protocol-tests/https.rb')
-rwxr-xr-x | lib/custodian/protocol-tests/https.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/custodian/protocol-tests/https.rb b/lib/custodian/protocol-tests/https.rb index 6c4a53a..0935ebb 100755 --- a/lib/custodian/protocol-tests/https.rb +++ b/lib/custodian/protocol-tests/https.rb @@ -129,8 +129,16 @@ class HTTPSTest response = http.start { http.get("#{url.path}?#{url.query}") } end - @status = response.code.to_i - @body = response.body + case response + when Net::HTTPRedirection + then + newURL = response['location'].match(/^http/)? + response['Location']:uri_str+response['Location'] + return( getURL(newURL) ) + else + @status = response.code.to_i + @body = response.body + end return true rescue Errno::EHOSTUNREACH => ex |