|
20 | 20 | importre |
21 | 21 | importtime |
22 | 22 | fromtypingimportAny,cast,Dict,List,Optional,Tuple,TYPE_CHECKING,Union |
| 23 | +fromurllibimportparse |
23 | 24 |
|
24 | 25 | importrequests |
25 | 26 | importrequests.utils |
@@ -677,11 +678,15 @@ def http_request( |
677 | 678 | GitlabHttpError: When the return code is not 2xx |
678 | 679 | """ |
679 | 680 | query_data=query_dataor {} |
680 | | -url=self._build_url(path) |
| 681 | +raw_url=self._build_url(path) |
681 | 682 |
|
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) |
683 | 686 | utils.copy_dict(src=query_data,dest=params) |
684 | 687 |
|
| 688 | +url=raw_url.replace(parsed.query,"").strip("?") |
| 689 | + |
685 | 690 | # Deal with kwargs: by default a user uses kwargs to send data to the |
686 | 691 | # gitlab server, but this generates problems (python keyword conflicts |
687 | 692 | # and python-gitlab/gitlab conflicts). |
|