From 60a5a393d8c42bfeb83f17eca6fcd04faaa6fd49 Mon Sep 17 00:00:00 2001 From: Julien Prigent Date: Wed, 11 Apr 2018 22:42:22 +0000 Subject: [PATCH] Add a comment about lowercase env. variables precedence over uppercase --- requests/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requests/utils.py b/requests/utils.py index 3f50d485..07f8c7f7 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -696,6 +696,8 @@ def should_bypass_proxies(url, no_proxy): :rtype: bool """ + # Prioritize lowercase environment variables over uppercase + # to keep a consistent behaviour with other http projects (curl, wget). get_proxy = lambda k: os.environ.get(k) or os.environ.get(k.upper()) # First check whether no_proxy is defined. If it is, check that the URL