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

Prevented caching of streaming responses.

The test introduced in 4b278131 accidentally passed because of a
limitation of Python < 3.3.

Refs #17758, #7581.
This commit is contained in:
Aymeric Augustin
2012-12-24 20:25:02 +01:00
parent 35d1cd0b28
commit 1c8be95a86
2 changed files with 10 additions and 13 deletions

View File

@@ -93,7 +93,7 @@ class UpdateCacheMiddleware(object):
if not self._should_update_cache(request, response):
# We don't need to update the cache, just return.
return response
if not response.status_code == 200:
if response.streaming or response.status_code != 200:
return response
# Try to get the timeout from the "max-age" section of the "Cache-
# Control" header before reverting to using the default cache_timeout