From f36e67be30f9b77294ab98ff92326084424acc21 Mon Sep 17 00:00:00 2001 From: Mads Nielsen Date: Thu, 15 Aug 2019 16:05:48 +0200 Subject: [PATCH 1/2] Update decorators.rb --- lib/decorators.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/decorators.rb b/lib/decorators.rb index a20b04e..0d73b3a 100644 --- a/lib/decorators.rb +++ b/lib/decorators.rb @@ -5,6 +5,7 @@ module JiraTaskDecorator require 'net/http' require 'uri' require 'json' + require 'base64' require_relative 'logging' attr_accessor :data @@ -108,6 +109,8 @@ def query(uri, usr = nil, pw = nil) req = Net::HTTP::Get.new(uri) unless usr.nil? Logging.verboseprint(3, "[PAC] Using basic authentication") + req['Authorization'] = "Basic " + Base64.encode64(usr+":"+pw) + req["Content-Type'] = "application/json" req.basic_auth usr, pw end From 0ee14cfc3336685ad7f8b9c6a60bd6876a4cc09a Mon Sep 17 00:00:00 2001 From: Mads Nielsen Date: Thu, 15 Aug 2019 16:10:17 +0200 Subject: [PATCH 2/2] Update decorators.rb --- lib/decorators.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/decorators.rb b/lib/decorators.rb index 0d73b3a..ee8e6fa 100644 --- a/lib/decorators.rb +++ b/lib/decorators.rb @@ -110,7 +110,7 @@ def query(uri, usr = nil, pw = nil) unless usr.nil? Logging.verboseprint(3, "[PAC] Using basic authentication") req['Authorization'] = "Basic " + Base64.encode64(usr+":"+pw) - req["Content-Type'] = "application/json" + req['Content-Type'] = "application/json" req.basic_auth usr, pw end