summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/http.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2017-04-10 10:41:50 +0300
committerSteve Kemp <steve@steve.org.uk>2017-04-10 10:41:50 +0300
commit69ac6cfbdaf9cbb25a0f73561d92a3d69accb434 (patch)
tree0eac0050f119673f421143be449f49f9cdf3c2b8 /lib/custodian/protocoltest/http.rb
parent334c67fa0e39f657dfe59b4a6c6445de20d5706b (diff)
Use standard URL username/password holders.10-support-http-basic-auth
Rather than: with auth 'username:password' We use: http://user:pass@example.com/
Diffstat (limited to 'lib/custodian/protocoltest/http.rb')
-rw-r--r--lib/custodian/protocoltest/http.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index 34e4b6e..a4c4adb 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -102,18 +102,12 @@ module Custodian
raise ArgumentError, "The test case has a different protocol in the URI than that which we're testing: #{@line} - \"#{test_type} != #{u.scheme}\""
end
-
#
- # Look for username & password
+ # Save username/password if they were specified
#
- if line =~ /with auth '([^']+)'/
- data = $1.dup
- @username, @password = data.split( ":" )
- end
- if line =~ /with auth "([^"]+)"/
- data = $1.dup
- @username, @password = data.split( ":" )
- end
+ @username = u.user if ( u.user )
+ @password = u.password if ( u.password )
+
#
# Expected status