diff --git a/lib/decorators.rb b/lib/decorators.rb index a20b04e..ee8e6fa 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