From 9327271d70bd8dc4782d4ea2e48a9c50155e38b5 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Sun, 26 May 2019 14:24:43 +1000 Subject: [PATCH] feat(webhooks): don't use username if empty string --- lib/pact_broker/domain/webhook_request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pact_broker/domain/webhook_request.rb b/lib/pact_broker/domain/webhook_request.rb index 86287726d..31db5960a 100644 --- a/lib/pact_broker/domain/webhook_request.rb +++ b/lib/pact_broker/domain/webhook_request.rb @@ -122,7 +122,7 @@ def http_request @http_request ||= begin req = Net::HTTP.const_get(method.capitalize).new(url) headers.each_pair { | name, value | req[name] = value } - req.basic_auth(username, password) if username + req.basic_auth(username, password) if username && username.size > 0 req.body = body unless body.nil? req end