Skip to content

Commit

Permalink
Fixed #6480 -- Added application/pdf the list of content types we don…
Browse files Browse the repository at this point in the history
…'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
malcolmt committed Feb 4, 2008
1 parent 0c4ea9b commit 5f47776
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions django/middleware/gzip.py
Expand Up @@ -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):
Expand Down

0 comments on commit 5f47776

Please sign in to comment.