summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-12 04:15:45 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-12 04:15:45 +0000
commita83e4cb1959edc1d5dc5ebe4e1065bbe254062a7 (patch)
tree4933a3bca4b4f018f0a5a5ec804d2a641b5967dc
parent6771f4e348926608a86bc5152defd90a82fa3624 (diff)
[1.0.X] Fixed #10630 -- Be even more conservative in GZipMiddleware for IE.
Patch from sebastien_noack. Backport of r10541 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10542 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/middleware/gzip.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/middleware/gzip.py b/django/middleware/gzip.py
index 3b849801da..47f75aa416 100644
--- a/django/middleware/gzip.py
+++ b/django/middleware/gzip.py
@@ -22,11 +22,10 @@ class GZipMiddleware(object):
if response.has_header('Content-Encoding'):
return response
- # Older versions of IE have issues with gzipped pages containing either
- # Javascript and PDF.
+ # MSIE have issues with gzipped respones of various content types.
if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
ctype = response.get('Content-Type', '').lower()
- if "javascript" in ctype or ctype == "application/pdf":
+ if not ctype.startswith("text/") or "javascript" in ctype:
return response
ae = request.META.get('HTTP_ACCEPT_ENCODING', '')