Adds support for Basic Auth in HTTP Endpoint URLs (#884)

This commit is contained in:
Paul Cleary
2019-11-22 17:26:55 +00:00
committed by Adam Cooke
parent a75c125931
commit 10f4808fbf
+2 -2
View File
@@ -18,8 +18,8 @@ module Postal
request = method.new(uri.path.length == 0 ? "/" : uri.path)
options[:headers].each { |k,v| request.add_field k, v }
if options[:username]
request.basic_auth(options[:username], options[:password])
if options[:username] || uri.user
request.basic_auth(options[:username] || uri.user, options[:password] || uri.password)
end
if options[:params].is_a?(Hash)