Skip to content

Commit 9bca72e

Browse files
committed
fix: parse uri query
1 parent 7534fd0 commit 9bca72e

File tree

1 file changed

+4
-2
lines changed
  • src/DIRAC/FrameworkSystem/private/authorization/utils

1 file changed

+4
-2
lines changed

src/DIRAC/FrameworkSystem/private/authorization/utils/Requests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from authlib.common.encoding import to_unicode
55
from authlib.oauth2 import OAuth2Request as _OAuth2Request
66
from authlib.oauth2.rfc6749.util import scope_to_list
7-
from urllib.parse import quote
7+
from urllib.parse import quote, urlparse
88

99

1010
class OAuth2Request(_OAuth2Request):
@@ -19,6 +19,7 @@ def addScopes(self, scopes):
1919

2020
def setQueryArguments(self, **kwargs):
2121
"""Set query arguments"""
22+
query = self.query = urlparse(self.uri).query
2223
for k in kwargs:
2324
# Quote value before add it to request query
2425
value = (
@@ -39,7 +40,8 @@ def path(self):
3940
4041
:return: str
4142
"""
42-
return self.uri.replace("?%s" % (self.query or ""), "")
43+
query = urlparse(self.uri).query
44+
return self.uri.replace("?%s" % (query or ""), "")
4345

4446
@property
4547
def groups(self):

0 commit comments

Comments
 (0)