Code

Ticket #15046: chromeframe_fix_rev_15168.diff

File chromeframe_fix_rev_15168.diff, 1.0 KB (added by chrj, 3 years ago)
Line 
1Index: django/http/utils.py
2===================================================================
3--- django/http/utils.py        (revision 15168)
4+++ django/http/utils.py        (working copy)
5@@ -38,7 +38,8 @@
6     while expecting the browser to cache it (only when the browser is IE). This
7     leads to IE not allowing the client to download.
8     """
9-    if 'MSIE' not in request.META.get('HTTP_USER_AGENT', '').upper():
10+    useragent = request.META.get('HTTP_USER_AGENT', '').upper()
11+    if 'MSIE' not in useragent and 'CHROMEFRAME' not in useragent:
12         return response
13 
14     offending_headers = ('no-cache', 'no-store')
15@@ -66,7 +67,8 @@
16     by clearing the Vary header whenever the mime-type is not safe
17     enough for Internet Explorer to handle.  Poor thing.
18     """
19-    if 'MSIE' not in request.META.get('HTTP_USER_AGENT', '').upper():
20+    useragent = request.META.get('HTTP_USER_AGENT', '').upper()
21+    if 'MSIE' not in useragent and 'CHROMEFRAME' not in useragent:
22         return response
23 
24     # These mime-types that are decreed "Vary-safe" for IE: