From 97eebcae2535960c4aae50d9895493e176c9a952 Mon Sep 17 00:00:00 2001 From: Pat Leamon Date: Fri, 23 Aug 2019 09:01:44 +1000 Subject: [PATCH] Update the regex to properly capture the authorisation token --- lib/avatax/connection.rb | 2 +- spec/avatax/connection_spec.rb | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 spec/avatax/connection_spec.rb diff --git a/lib/avatax/connection.rb b/lib/avatax/connection.rb index 385fad1..04e47bd 100644 --- a/lib/avatax/connection.rb +++ b/lib/avatax/connection.rb @@ -4,7 +4,7 @@ module AvaTax module Connection private - AUTHORIZATION_FILTER_REGEX = /(Authorization\:\ \"Basic\ )(\w+)\=/ + AUTHORIZATION_FILTER_REGEX = /(Authorization\:\ \"Basic\ )(\w+\=*)/ REMOVED_LABEL = '\1[REMOVED]' def connection diff --git a/spec/avatax/connection_spec.rb b/spec/avatax/connection_spec.rb new file mode 100644 index 0000000..1244f48 --- /dev/null +++ b/spec/avatax/connection_spec.rb @@ -0,0 +1,42 @@ +require File.expand_path('../../spec_helper', __FILE__) + +describe AvaTax::Connection do + describe "AUTHORIZATION_FILTER_REGEX" do + let(:message) do + <