#25623: Django always returns a white page along with 400 on latin encoded URLs.
-----------------------------+--------------------
Reporter: shredding | Owner: nobody
Type: Bug | Status: new
Component: Core (URLs) | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------
Given a URL like /Raumh%F6he.htm served with gunicorn and waitress (maybe
others as well), django raises a UnicodeDecodeError here:
https://github.com/django/django/blob/master/django/core/handlers/wsgi.py#L200
... which ends up in serving a white page with a 400 (sample:
https://www.djangoproject.com/Raumh%F6he.htm)
This does not happen with the built in runserver command, because it
double encodes the query, as far as I understand:
https://github.com/django/django/blob/master/django/core/servers/basehttp.py#L154-L157
Gunicorn on the other hand is explicitly casting to latin:
https://github.com/benoitc/gunicorn/blob/master/gunicorn/_compat.py#L82
... which leads to the error as django is explicitly expecting utf-8.
--
Ticket URL: <https://code.djangoproject.com/ticket/25623>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.f643bc44383f80c1c85012a7b3128e9d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.