summaryrefslogtreecommitdiff
path: root/django
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:30:20 +0100
commitcd914175c8209c5f366e87d94f8f6d050347757d (patch)
tree3a2c7a1b1d8e3df4a82f8fc38cf26a74ce941df0 /django
parentef98ae2910a6b5c86e1e0b003110455778e63324 (diff)
[1.5.x] Prevented caching of streaming responses.
The test introduced in 4b278131 accidentally passed because of a limitation of Python < 3.3. Refs #17758, #7581. Backport of 1c8be95 from master.
Diffstat (limited to 'django')
-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 34bf0ca4a4..94c18eac1e 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