Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #6480 -- Added application/pdf the list of content types we don…

…'t compress when sending to Internet Explorer. Thanks, Bastien Kleineidam.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7080 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5f477760ac02ad94a41f4a2373ed9ed9948a0ac3 1 parent 0c4ea9b
@malcolmt malcolmt authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 django/middleware/gzip.py
View
12 django/middleware/gzip.py
@@ -22,12 +22,12 @@ def process_response(self, request, response):
if response.has_header('Content-Encoding'):
return response
- # Older versions of IE have issues with gzipped javascript.
- # See http://code.djangoproject.com/ticket/2449
- is_ie = "msie" in request.META.get('HTTP_USER_AGENT', '').lower()
- is_js = "javascript" in response.get('Content-Type', '').lower()
- if is_ie and is_js:
- return response
+ # Older versions of IE have issues with gzipped pages containing either
+ # Javascript and PDF.
+ if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
+ ctype = response.get('Content-Type', '').lower()
+ if "javascript" in ctype or ctype == "application/pdf":
+ return response
ae = request.META.get('HTTP_ACCEPT_ENCODING', '')
if not re_accepts_gzip.search(ae):
Please sign in to comment.
Something went wrong with that request. Please try again.