summaryrefslogtreecommitdiff
path: root/django/middleware/cache.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-12-24 20:25:02 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-12-24 20:28:07 +0100
commit1c8be95a864540d416602577d1aa03d58ba33168 (patch)
treed911902a8ad237349ffb1aff12bd42d8134f3e9d /django/middleware/cache.py
parent35d1cd0b28d1d9cd7bffbfbc6cc2e02b58404415 (diff)
Prevented caching of streaming responses.
The test introduced in 4b278131 accidentally passed because of a limitation of Python < 3.3. Refs #17758, #7581.
Diffstat (limited to 'django/middleware/cache.py')
-rw-r--r--django/middleware/cache.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/middleware/cache.py b/django/middleware/cache.py
index de2b86f630..83860e15f3 100644
--- a/django/middleware/cache.py
+++ b/django/middleware/cache.py
@@ -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