-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Hello.
I wasn't sure if I should reopen/comment on #2126 or make a new issue.
I've recently run into this change to the default behaviour around following redirects, and I'd like to be able to easily refactor my large codebase to set the default behaviour back. I'd also like be able to change the default to prevent other coders who may be unaware of this behaviour from inadvertently doing a get(url) without specifying follow_redirects (we almost always want to follow redirects in our codebase)
What I'd like to do is have a new config item in httpx._config similar to DEFAULT_MAX_REDIRECTS. This would be called something like DEFAULT_FOLLOW_REDIRECTS and would determine the default behaviour of follow_redirects is not provided
I'd like to do this to allow for usage like:
import httpx
httpx.DEFAULT_FOLLOW_REDIRECTS = True
httpx.get(some_url)rather than having to either pass follow_redirects as a param to get or instantiate and persist a Client with follow_redirects=True
I think I could put together a PR to do this change, would that be likely to be accepted if I were to do so? Is there anything I should know before I write the code? :)
Thanks