-
-
Notifications
You must be signed in to change notification settings - Fork 800
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
CookieMiddleware should decode() using latin-1
.
#1450
Comments
I have the same issue using the version of 2.3.0. |
As far as I can tell cookies are meant to only contain US-ASCII characters... e.g. https://tools.ietf.org/id/draft-ietf-httpstate-cookie-23.html#sane-set-cookie-syntax
Searching doesn't point to anything particularly definitive. Will close: happy to re-open if more info comes up. |
Some historical discussion on Gunicorn here: benoitc/gunicorn#1778 Eventually looks like they eased to Maybe we should do that. |
So it looks like |
latin-1
.
Todo:
|
@carltongibson Hey is this issue still pending ? |
Hi @Dhruv-Sachdev1313 — looks like it's handled in #1494. If you want to review that it would be great. |
Okay @carltongibson . Thanks !! |
We have been periodically getting this error stack trace in our logs:
When investigating, I found out that the issue is at this line:
channels/channels/sessions.py
Line 41 in dd30456
when there is a cookie that has a non-ascii value.
Is there a reason that it is assumed that the cookie value will not have non-ascii values? If so, what would be the work around?
If not, is there an issue with changing this?
For example, would it be safe to do this:
cookies = parse_cookie(value.decode("ascii", errors='ignore'))
The text was updated successfully, but these errors were encountered: