diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2021-12-21 14:57:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-21 14:57:57 +0100 |
| commit | eef8059d63f4c882fca6390ae18e3002e86c90d9 (patch) | |
| tree | e43e31d459824eb21e00df7cb14f1b4a14717b19 /gitlab/client.py | |
| parent | 182ab9243f6777ac3319a68905c7ad6e6bdcd77b (diff) | |
| parent | 702e41dd0674e76b292d9ea4f559c86f0a99edfe (diff) | |
| download | gitlab-eef8059d63f4c882fca6390ae18e3002e86c90d9.tar.gz | |
Merge pull request #1766 from python-gitlab/jlvillal/leave_dot
fix: stop encoding '.' to '%2E'
Diffstat (limited to 'gitlab/client.py')
| -rw-r--r-- | gitlab/client.py | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/gitlab/client.py b/gitlab/client.py index 97eae4d..84fd40f 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -593,24 +593,19 @@ class Gitlab(object): json, data, content_type = self._prepare_send_data(files, post_data, raw) opts["headers"]["Content-type"] = content_type - # Requests assumes that `.` should not be encoded as %2E and will make - # changes to urls using this encoding. Using a prepped request we can - # get the desired behavior. - # The Requests behavior is right but it seems that web servers don't - # always agree with this decision (this is the case with a default - # gitlab installation) - req = requests.Request(verb, url, json=json, data=data, params=params, **opts) - prepped = self.session.prepare_request(req) - if TYPE_CHECKING: - assert prepped.url is not None - prepped.url = utils.sanitized_url(prepped.url) - settings = self.session.merge_environment_settings( - prepped.url, {}, streamed, verify, None - ) - cur_retries = 0 while True: - result = self.session.send(prepped, timeout=timeout, **settings) + result = self.session.request( + method=verb, + url=url, + json=json, + data=data, + params=params, + timeout=timeout, + verify=verify, + stream=streamed, + **opts, + ) self._check_redirects(result) |
