Skip to content

Commit 4f08477

Browse files
committed
Remove inaccurate RE which came from ADAL Python
Porting ADAL Python PR 194 (AzureAD/azure-activedirectory-library-for-python#194)
1 parent 518f112 commit 4f08477

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

msal/wstrust_request.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import uuid
2929
from datetime import datetime, timedelta
30-
import re
3130
import logging
3231

3332
import requests
@@ -44,11 +43,9 @@ def send_request(
4443
if not endpoint_address:
4544
raise ValueError("WsTrust endpoint address can not be empty")
4645
if soap_action is None:
47-
wstrust2005_regex = r'[/trust]?[2005][/usernamemixed]?'
48-
wstrust13_regex = r'[/trust]?[13][/usernamemixed]?'
49-
if re.search(wstrust2005_regex, endpoint_address):
46+
if '/trust/2005/usernamemixed' in endpoint_address:
5047
soap_action = Mex.ACTION_2005
51-
elif re.search(wstrust13_regex, endpoint_address):
48+
elif '/trust/13/usernamemixed' in endpoint_address:
5249
soap_action = Mex.ACTION_13
5350
assert soap_action in (Mex.ACTION_13, Mex.ACTION_2005) # A loose check here
5451
data = _build_rst(

0 commit comments

Comments
 (0)