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
This commit is contained in:
parent
0c4ea9b922
commit
5f477760ac
|
@ -22,12 +22,12 @@ class GZipMiddleware(object):
|
||||||
if response.has_header('Content-Encoding'):
|
if response.has_header('Content-Encoding'):
|
||||||
return response
|
return response
|
||||||
|
|
||||||
# Older versions of IE have issues with gzipped javascript.
|
# Older versions of IE have issues with gzipped pages containing either
|
||||||
# See http://code.djangoproject.com/ticket/2449
|
# Javascript and PDF.
|
||||||
is_ie = "msie" in request.META.get('HTTP_USER_AGENT', '').lower()
|
if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
|
||||||
is_js = "javascript" in response.get('Content-Type', '').lower()
|
ctype = response.get('Content-Type', '').lower()
|
||||||
if is_ie and is_js:
|
if "javascript" in ctype or ctype == "application/pdf":
|
||||||
return response
|
return response
|
||||||
|
|
||||||
ae = request.META.get('HTTP_ACCEPT_ENCODING', '')
|
ae = request.META.get('HTTP_ACCEPT_ENCODING', '')
|
||||||
if not re_accepts_gzip.search(ae):
|
if not re_accepts_gzip.search(ae):
|
||||||
|
|
Loading…
Reference in New Issue