#34989: APPEND_SLASH redirects much slower in Django 4.2 when used with uWSGI's
http11-socket
-------------------------------------+-------------------------------------
Reporter: Jeppe Fihl-Pearson | Owner: Anders
| Kaseorg
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Normal | Resolution:
Keywords: CommonMiddleware | Triage Stage:
uWSGI | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Florian Apolloner):
> the HTTP server must send either `Content-Length` or `Transfer-Encoding:
chunked`
I do not think this is true, a third option is most likely to simply close
the connection.
> It’s less clear that the WSGI application should be responsible for
sending it explicitly.
It is explicitly clear that the WSGI application is not required to send
this in PEP 3333 (https://peps.python.org/pep-3333/#handling-the-content-
length-header):
> If the application does not supply a Content-Length header, a server or
gateway may choose one of several approaches to handling it. The simplest
of these is to close the client connection when the response is completed.
So I would argue that this is a bug in uWSGI. This is also not the first
WSGI incompatibility in uWGSI, for instance I fixed a rather annoying
issue with close:
https://github.com/unbit/uwsgi/commit/1746254fec076bd52e7682187041e82fafad5427
> This is easy to reproduce without Django, so I don’t think we should
feel obligated to avoid fixing this just to have a reproduction recipe.
The thing is, if we fix this in Django just to workaround about a spec
incompatibility in uWSGI (imo), then the next framework has to do the same
and we just might hide a harder to fix bug. Fixing this in uWSGI would
properly fix this for all frameworks.
--
Ticket URL: <https://code.djangoproject.com/ticket/34989#comment:6>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018bf866bd39-4b823d85-d355-4dc4-ac04-b86ac7e4d4be-000000%40eu-central-1.amazonses.com.