mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
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'):
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user