Skip to content

Commit cb5e2fc

Browse files
pquentinsethmlarson
authored andcommitted
[1.26] Don't compare bytes and str in putheader()
1 parent b89158f commit cb5e2fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/urllib3/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def putrequest(self, method, url, *args, **kwargs):
215215

216216
def putheader(self, header, *values):
217217
""""""
218-
if SKIP_HEADER not in values:
218+
if not any(isinstance(v, str) and v == SKIP_HEADER for v in values):
219219
_HTTPConnection.putheader(self, header, *values)
220220
elif six.ensure_str(header.lower()) not in SKIPPABLE_HEADERS:
221221
raise ValueError(

0 commit comments

Comments
 (0)