Skip to content

no_proxy env ignored on 302 redirect #3296

Open
@Gaasmann

Description

@Gaasmann

Hello,

I have a weird problem using Requests and proxies.
I have https_proxy and no_proxy env variable for a domain and it seems the no_proxy is ignored on a HTTP 302 redirect target.
What I do is basically:

s = requests.Session()
r = s.get("https://use-the-proxy.com")

The response is 302 Found (Location: https://do-not-use-the-proxy.com) and Requests tries to follow.
Here the problem: even if do-not-use-the-proxy.com is present in no_proxy, Requests still use the proxy for the request following a 302(the 302 "target").
If I directly request https://do-not-use-the-proxy.com, the proxy is not used as expected.

Thanks,

Nico

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions