Skip to content

Commit 6f50447

Browse files
author
Gauvain Pocentek
committed
Respect content of REQUESTS_CA_BUNDLE and *_proxy envvars
Explicitly call the requests session.merge_environment_settings() method, which will use some environment variables to setup the session properly. Closes python-gitlab#352
1 parent 2e2a78d commit 6f50447

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

RELEASE_NOTES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This page describes important changes between python-gitlab releases.
77
Changes from 1.1 to 1.2
88
=======================
99

10+
* python-gitlab now respects the ``*_proxy``, ``REQUESTS_CA_BUNDLE`` and
11+
``CURL_CA_BUNDLE`` environment variables (#352)
1012
* The following deprecated methods and objects have been removed:
1113

1214
* gitlab.v3.object ``Key`` and ``KeyManager`` objects: use ``DeployKey`` and

gitlab/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,9 @@ def copy_dict(dest, src):
677677
files=files, **opts)
678678
prepped = self.session.prepare_request(req)
679679
prepped.url = sanitized_url(prepped.url)
680-
result = self.session.send(prepped, stream=streamed, verify=verify,
681-
timeout=timeout)
680+
settings = self.session.merge_environment_settings(
681+
prepped.url, {}, streamed, verify, None)
682+
result = self.session.send(prepped, timeout=timeout, **settings)
682683

683684
if 200 <= result.status_code < 300:
684685
return result

0 commit comments

Comments
 (0)