summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2017-04-10 11:33:42 +0300
committerSteve Kemp <steve@steve.org.uk>2017-04-10 11:33:42 +0300
commit8934f73320480b26ff4909139539f4937105610b (patch)
tree5970d262854c643a30fd2f5e2539f4176b507006 /lib/custodian
parent5703a7727fe69c492296f126ce28b06b7a6a11a0 (diff)
Remove username/password prior to testing URL with curb.
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/protocoltest/http.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index a4c4adb..dfd8ee4 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -108,7 +108,6 @@ module Custodian
@username = u.user if ( u.user )
@password = u.password if ( u.password )
-
#
# Expected status
#
@@ -254,6 +253,17 @@ module Custodian
end
end
+ #
+ # If we're running with HTTP-basic-auth we should remove
+ # the username/password from the URL we're passing to curb.
+ #
+ if ( basic_auth? )
+ u = URI.parse(test_url)
+ u.user = nil
+ u.password = nil
+ test_url = u.to_s
+ end
+
errors = []
resolution_errors = []