kennethreitz/requests — pull request #1951 by Lukasa (2014-03-12 19:26:15+00:00)
Title: Re-evaluate proxy authorization. [DO NOT MERGE]

This pull request falls into three commits.

The first is a refactoring of the `get_environ_proxies` method to make it possible to evaluate whether a given URL is in the NO_PROXY list.

The second is a refactoring of the `resolve_redirects` method to move rebuilding the `Authorization` header to its own method.

Both of these commits are intended to set the stage for the third, which is a new method that re-evaluates proxy configuration on a redirect, and re-evaluates proxy authorization as well.

I don't want this merged yet, but it's a pretty sizeable change and I'd like to get eyes on it as early as possible. The key problem right now is that I don't have tests, though it should be possible for me to test this fairly easily. I'll want to add tests before we merge this.

@sigmavirus24, do you mind taking a look?