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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user