diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-24 20:25:02 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-12-24 20:30:20 +0100 |
| commit | cd914175c8209c5f366e87d94f8f6d050347757d (patch) | |
| tree | 3a2c7a1b1d8e3df4a82f8fc38cf26a74ce941df0 /django | |
| parent | ef98ae2910a6b5c86e1e0b003110455778e63324 (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.py | 2 |
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 |
