diff options
| author | Johannes Hoppe <info@johanneshoppe.com> | 2015-11-11 20:17:32 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-12-14 12:46:48 -0500 |
| commit | 5233b70070f8979f41ca1da2c1b1d78c8e30944e (patch) | |
| tree | 54993a920bb9df5cdfbbc92dc4fbb010a1d662a5 /docs | |
| parent | a6c803a2e3d270818d20f3f0c76e2241de9f0ab1 (diff) | |
Fixed #25725 -- Made HttpReponse immediately close objects.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/request-response.txt | 8 | ||||
| -rw-r--r-- | docs/releases/1.10.txt | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 81f992a778..675a47d8d0 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -608,11 +608,17 @@ Passing iterators Finally, you can pass ``HttpResponse`` an iterator rather than strings. ``HttpResponse`` will consume the iterator immediately, store its content as a -string, and discard it. +string, and discard it. Objects with a ``close()`` method such as files and +generators are immediately closed. If you need the response to be streamed from the iterator to the client, you must use the :class:`StreamingHttpResponse` class instead. +.. versionchanged:: 1.10 + + Objects with a ``close()`` method used to be closed when the WSGI server + called ``close()`` on the response. + Setting header fields ~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt index 6f94154929..d932887a51 100644 --- a/docs/releases/1.10.txt +++ b/docs/releases/1.10.txt @@ -357,6 +357,10 @@ Miscellaneous * The ``add_postgis_srs()`` backwards compatibility alias for ``django.contrib.gis.utils.add_srs_entry()`` is removed. +* Objects with a ``close()`` method such as files and generators passed to + :class:`~django.http.HttpResponse` are now closed immediately instead of when + the WSGI server calls ``close()`` on the response. + .. _deprecated-features-1.10: Features deprecated in 1.10 |
