#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 Anders Kaseorg):
A redirect response is allowed to have a body, so in order for keep-alive
to work, the HTTP server must send either `Content-Length` or `Transfer-
Encoding: chunked`. It’s less clear that the WSGI application should be
responsible for sending it explicitly. I would have expected uWSGI to
automatically add `Transfer-Encoding` if `Content-Length` is not provided,
but evidently it doesn’t.
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.
{{{
#!python3
def application(environ, start_response):
body = b"Hello, world!"
start_response(
"200 OK",
[
# ("Content-Length", str(len(body))), # uncomment to fix
],
)
yield body
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34989#comment:5>
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/0107018bf85a0f77-cff5bfd0-c79a-4987-a374-5236d2bf11cc-000000%40eu-central-1.amazonses.com.