From bab9ca9f7148d6a7f15b83cfa1126bf1c8ceb17d Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 26 Jan 2021 18:04:17 +0400 Subject: [PATCH] Don't compare bytes and str in putheader() --- src/urllib3/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py index 660d679c..387f3770 100644 --- a/src/urllib3/connection.py +++ b/src/urllib3/connection.py @@ -215,7 +215,7 @@ class HTTPConnection(_HTTPConnection, object): def putheader(self, header, *values): """""" - if SKIP_HEADER not in values: + if not any(isinstance(v, str) and v == SKIP_HEADER for v in values): _HTTPConnection.putheader(self, header, *values) elif six.ensure_str(header.lower()) not in SKIPPABLE_HEADERS: raise ValueError( -- 2.30.0