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
parse_authorization_header raises UnicodeDecodeError, not returning None #1816
Comments
This is an issue with how you constructed the header, you relied on whatever encoding your local machine was set to rather than using 'utf-8'. I don't think this needs to be handled in Werkzeug as it shouldn't come up in normal use and would indicate an issue with the client if the encoding it sends doesn't decode the bytes. |
Such behaviour differs from docstring. In fact Authorization header is improperly formatted and invalid. I.e. |
The server should not crash as a result of the client sending bad data. This is indeed a bug in the function that should be fixed. |
werkzeug.http.parse_authorization_header()
docstring states:But in case of passing string improperly formatted (i.e. not properly UTF-8 encoded) it raises UnicodeDecodeError exception:
Am I right that exception handling should be added in
parse_authorization_header()
?The text was updated successfully, but these errors were encountered: