blob: dfa761c5631e677fa6505ea90f5bdc8d54b4643a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
From bab9ca9f7148d6a7f15b83cfa1126bf1c8ceb17d Mon Sep 17 00:00:00 2001
From: Quentin Pradet <quentin@pradet.me>
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
|