Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.26] Don't compare bytes and str in putheader() #2142

Merged
merged 3 commits into from Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -24,6 +24,7 @@ notifications:
env:
global:
- PYTHONWARNINGS=always::DeprecationWarning
- CRYPTOGRAPHY_ALLOW_OPENSSL_102=1

- PYPI_USERNAME=urllib3
# PYPI_PASSWORD is set in Travis control panel.
Expand Down
2 changes: 1 addition & 1 deletion ci/install.sh
Expand Up @@ -8,7 +8,7 @@ set -exo pipefail
# we're in one of the Travis Python 2 sessions and sets up the Python 3 install
# for Nox.
if ! python3 -m pip --version; then
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
curl https://bootstrap.pypa.io/3.5/get-pip.py -o get-pip.py
sudo python3 get-pip.py
# https://github.com/theacodes/nox/issues/328
sudo python3 -m pip install nox==2019.11.9
Expand Down
2 changes: 1 addition & 1 deletion src/urllib3/connection.py
Expand Up @@ -215,7 +215,7 @@ def putrequest(self, method, url, *args, **kwargs):

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(
Expand Down