From 67b3d60e71583615d22d809f6605f76a6a3f53e7 Mon Sep 17 00:00:00 2001 From: Martin Strobel Date: Thu, 23 May 2019 16:53:07 -0700 Subject: [PATCH 1/2] Updating authority URL regexp to have escaped backslash --- msal/authority.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msal/authority.py b/msal/authority.py index e575fbe7..04463704 100644 --- a/msal/authority.py +++ b/msal/authority.py @@ -65,7 +65,7 @@ def user_realm_discovery(self, username): def canonicalize(url): # Returns (canonicalized_url, netloc, tenant). Raises ValueError on errors. - match_object = re.match("https://([^/]+)/([^/\?#]+)", url.lower()) + match_object = re.match(r'https://([^/]+)/([^/?#\\]+)', url.lower()) if not match_object: raise ValueError( "Your given address (%s) should consist of " From ce450a79d8c289678f799ad47d0c297fd131220e Mon Sep 17 00:00:00 2001 From: Martin Strobel Date: Fri, 24 May 2019 09:57:08 -0700 Subject: [PATCH 2/2] Removing backslash from pattern --- msal/authority.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msal/authority.py b/msal/authority.py index 04463704..689ea8cb 100644 --- a/msal/authority.py +++ b/msal/authority.py @@ -65,7 +65,7 @@ def user_realm_discovery(self, username): def canonicalize(url): # Returns (canonicalized_url, netloc, tenant). Raises ValueError on errors. - match_object = re.match(r'https://([^/]+)/([^/?#\\]+)', url.lower()) + match_object = re.match(r'https://([^/]+)/([^/?#]+)', url.lower()) if not match_object: raise ValueError( "Your given address (%s) should consist of "