1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #28786 -- Doc'd middleware ordering considerations due to CommonMiddleware setting Content-Length.

This commit is contained in:
Tim Graham
2017-11-08 10:02:30 -05:00
parent 23bf4ad87f
commit bc95314ca6
2 changed files with 10 additions and 0 deletions

View File

@@ -730,6 +730,12 @@ Miscellaneous
``Content-Length`` header as this is now done by
:class:`~django.middleware.common.CommonMiddleware`.
If you have a middleware that modifies a response's content and appears
before ``CommonMiddleware`` in the ``MIDDLEWARE`` or ``MIDDLEWARE_CLASSES``
settings, you must reorder your middleware so that responses aren't modified
after ``Content-Length`` is set, or have the response modifying middleware
reset the ``Content-Length`` header.
* :meth:`~django.apps.AppConfig.get_model` and
:meth:`~django.apps.AppConfig.get_models` now raise
:exc:`~django.core.exceptions.AppRegistryNotReady` if they're called before