diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-14 10:53:27 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-14 10:53:27 +0000 |
commit | ece857c064e54d4e85f639c64793c7161e8cf58a (patch) | |
tree | 60e08a9dcc09c5f4fd4b6f0ce15aeae7944003c1 /lib/custodian/protocol-tests | |
parent | 45d9140382e71f6216b22b8bf46c3546d16dc2eb (diff) |
URL should add a path if missing
Diffstat (limited to 'lib/custodian/protocol-tests')
-rwxr-xr-x | lib/custodian/protocol-tests/http.rb | 7 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/https.rb | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/custodian/protocol-tests/http.rb b/lib/custodian/protocol-tests/http.rb index 2a60063..e1e0ad0 100755 --- a/lib/custodian/protocol-tests/http.rb +++ b/lib/custodian/protocol-tests/http.rb @@ -127,6 +127,13 @@ class HTTPTest response = nil + # + # Ensure we have a trailing "/" + # + if ( url.path.empty? ) + url.path = "/" + end + if nil == url.query response = http.start { http.get(url.path) } else diff --git a/lib/custodian/protocol-tests/https.rb b/lib/custodian/protocol-tests/https.rb index 8fb643f..8db4da5 100755 --- a/lib/custodian/protocol-tests/https.rb +++ b/lib/custodian/protocol-tests/https.rb @@ -130,6 +130,13 @@ class HTTPSTest response = nil + # + # Ensure we have a trailing "/" + # + if ( url.path.empty? ) + url.path = "/" + end + if nil == url.query response = http.start { http.get(url.path) } else |