Sanjays2402 commented on PR #2171:
URL: https://github.com/apache/libcloud/pull/2171#issuecomment-5612864218
You're right — I traced it through requests' source and confirmed:
Session.request() runs merge_setting(proxies, self.proxies), so passing {}
merged the session-level proxy straight back in. I verified this locally:
merge_setting({}, session_proxies) returns the session proxies, while
merge_setting({'http': None, 'https': None}, session_proxies) strips the None
values and yields an empty mapping. Fixed in 34fd511 — _proxies_for_url() now
returns {'http': None, 'https': None} when bypassing, and I added the
end-to-end-ish test you asked for: it mocks HTTPAdapter.send, drives
LibcloudConnection.request(), and asserts the proxy mapping that actually
reaches the adapter (no session proxy leaked, select_proxy() returns None),
plus a control case proving non-bypassed hosts still use the configured proxy.
The new test fails on the old code and passes on the new.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]