summaryrefslogtreecommitdiff
path: root/requests/utils.py
diff options
context:
space:
mode:
authorIan Stapleton Cordasco <graffatcolmingov@gmail.com>2020-12-12 11:29:02 -0600
committerIan Stapleton Cordasco <graffatcolmingov@gmail.com>2020-12-25 09:41:39 -0600
commit6ab16db7bd55bc63dca2b6ef8ad04d37117927af (patch)
tree79832bc6977db0a1c19923e0d6df76760af2289b /requests/utils.py
parentd3e0f73354051f824cae563aeae215006158da28 (diff)
downloadpython-requests-bug/5671.tar.gz
Pass urllib3.SKIP_HEADER when headers should be unsetbug/5671
urllib3 introduced some default headers and a way to skip them if desired. Let's use that sentinel value to pass along information about Requests' users desire to skip those headers as well. Closes gh-5671
Diffstat (limited to 'requests/utils.py')
-rw-r--r--requests/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/requests/utils.py b/requests/utils.py
index db67938e..905c9330 100644
--- a/requests/utils.py
+++ b/requests/utils.py
@@ -947,6 +947,8 @@ def check_header_validity(header):
:param header: tuple, in the format (name, value).
"""
name, value = header
+ if value is None:
+ return
if isinstance(value, bytes):
pat = _CLEAN_HEADER_REGEX_BYTE