requests icon indicating copy to clipboard operation
requests copied to clipboard

Fix no_proxy and no, not being respected. Merge self.proxies and proxies

Open Suika opened this issue 5 years ago • 7 comments
trafficstars

Since no_proxy is not working as intended, I tried fixing it with least intrsion into whole process. It is contained to the merge_environment_settings and request function. In the request the proxy from request and proxy from session are merged. Having the request proxy overwrite the session proxy where needed.

The should_bypass_proxies is applied outside get_environ_proxies in merge_environment_settings, since no_proxy is only applied to OS ENV and not the proxies set in requests or Sessions

Should close #4871, I hope.

Suika avatar Sep 24 '20 14:09 Suika

This patched fixed #5731 for me. I was very surprised this patch has not gotten any attention yet. Is there anything missing before it can be considered?

RichieB2B avatar Jun 20 '22 16:06 RichieB2B

Hi @Suika and @RichieB2B, we are also dealing with this issue, any updates?

kurago-dev avatar Nov 16 '22 14:11 kurago-dev

I found a work around that I described at https://github.com/psf/requests/issues/5731#issuecomment-1162215349 and in #6172

RichieB2B avatar Nov 16 '22 19:11 RichieB2B

Hi, we are also being hit by that and would appreciate if this issue would be fixed.

livenson avatar Jan 25 '23 11:01 livenson

Also being hit by this; in our case it's setting proxies on the Session instance, but then the call to proxies = merge_settings(...) basically doesn't respect should_bypass_proxy() because it happens later.

JMMarchant avatar Nov 30 '23 13:11 JMMarchant