#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       |               Resolution:
     Keywords:               |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+--------------------------------------
Changes (by shredding):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Old description:

> 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.

New description:

 Given a URL like /Raumh%F6he 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)

 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#comment:1>
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/067.aef8afb476485779f9eb0b50d07af35c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to