Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1398426

Browse files
committed
fix(client): ensure encoded query params are never duplicated
1 parent6f71c66 commit1398426

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎gitlab/client.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
importre
2121
importtime
2222
fromtypingimportAny,cast,Dict,List,Optional,Tuple,TYPE_CHECKING,Union
23+
fromurllibimportparse
2324

2425
importrequests
2526
importrequests.utils
@@ -677,11 +678,15 @@ def http_request(
677678
GitlabHttpError: When the return code is not 2xx
678679
"""
679680
query_data=query_dataor {}
680-
url=self._build_url(path)
681+
raw_url=self._build_url(path)
681682

682-
params:Dict[str,Any]= {}
683+
# parse user-provided URL params to ensure we don't add our own duplicates
684+
parsed=parse.urlparse(raw_url)
685+
params=parse.parse_qs(parsed.query)
683686
utils.copy_dict(src=query_data,dest=params)
684687

688+
url=raw_url.replace(parsed.query,"").strip("?")
689+
685690
# Deal with kwargs: by default a user uses kwargs to send data to the
686691
# gitlab server, but this generates problems (python keyword conflicts
687692
# and python-gitlab/gitlab conflicts).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp