diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-06-09 21:24:05 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-06-10 08:42:31 +0200 |
| commit | df09d854828bcff56eb72f48ff1ba8fce7e90c90 (patch) | |
| tree | e76d45e66bc656a102587b9b4753cd7a4d4f2ae4 /django | |
| parent | fea8ccdcc4fa47ea1d494843624c92197b4f2153 (diff) | |
Fixed #17552 -- Removed a hack for IE6 and earlier.
It prevented the GZipMiddleware from compressing some data types even on
more recent version of IE where the corresponding bug was fixed.
Thanks Aaron Cannon for the report and Tim Graham for the review.
Diffstat (limited to 'django')
| -rw-r--r-- | django/middleware/gzip.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/django/middleware/gzip.py b/django/middleware/gzip.py index e9e955d704..8548c083e3 100644 --- a/django/middleware/gzip.py +++ b/django/middleware/gzip.py @@ -17,17 +17,11 @@ class GZipMiddleware(object): if not response.streaming and len(response.content) < 200: return response - patch_vary_headers(response, ('Accept-Encoding',)) - # Avoid gzipping if we've already got a content-encoding. if response.has_header('Content-Encoding'): return response - # MSIE have issues with gzipped response of various content types. - if "msie" in request.META.get('HTTP_USER_AGENT', '').lower(): - ctype = response.get('Content-Type', '').lower() - if not ctype.startswith("text/") or "javascript" in ctype: - return response + patch_vary_headers(response, ('Accept-Encoding',)) ae = request.META.get('HTTP_ACCEPT_ENCODING', '') if not re_accepts_gzip.search(ae): |
