diff --git a/lib/chroma/api_operations/request.rb b/lib/chroma/api_operations/request.rb index 2eb4e1a..f43f84b 100644 --- a/lib/chroma/api_operations/request.rb +++ b/lib/chroma/api_operations/request.rb @@ -44,7 +44,7 @@ def execute_request(method, url, params = {}, options = {}) request = build_request(method, uri, params) - use_ssl = options.delete(:use_ssl) || false + use_ssl = uri.scheme == "https" response = Net::HTTP.start(uri.hostname, uri.port, use_ssl:) do |http| Chroma::Util.log_debug("Sending a request", {method:, uri:, params:}) http.request(request) @@ -117,6 +117,7 @@ def execute_request(method, url, params = {}, options = {}) request.content_type = "application/json" request.body = params.to_json if params.size > 0 + request.basic_auth(uri.user, uri.password) if uri.user.present? request end