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

The default charset for the basic http authentication is utf-8. #1325

Merged
merged 2 commits into from Nov 13, 2018

Conversation

@Flyguy
Copy link
Contributor

@Flyguy Flyguy commented Jun 11, 2018

#1323

werkzeug/http.py Outdated
@@ -505,8 +506,8 @@ def parse_authorization_header(value):
username, password = base64.b64decode(auth_info).split(b':', 1)
except Exception:
return
return Authorization('basic', {'username': bytes_to_wsgi(username),
'password': bytes_to_wsgi(password)})
return Authorization('basic', {'username': to_unicode(username, _basic_auth_charset),
Copy link
Member

@edk0 edk0 Jul 5, 2018

I think this needs to use to_native

@davidism
Copy link
Member

@davidism davidism commented Nov 13, 2018

Rebased, added changelog. Changed this to use to_unicode, as username and password could only contain ASCII anyway, and string operations on unicode that only contains ASCII should still work in Python 2.

@davidism davidism added this to the 0.15 milestone Nov 13, 2018
@davidism davidism merged commit 6e83117 into pallets:master Nov 13, 2018
1 check passed
nicolaiarocci added a commit to pyeve/eve that referenced this issue Mar 20, 2019
With v0.15 the test suite breaks our auth tests. Culprit appears to be:
pallets/werkzeug#1325

Pinning the dependency until I have time to look into it.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants