diff options
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/http/utils.py b/django/http/utils.py index 5eea23907b..01808648ba 100644 --- a/django/http/utils.py +++ b/django/http/utils.py @@ -76,7 +76,8 @@ def fix_IE_for_vary(request, response): # The first part of the Content-Type field will be the MIME type, # everything after ';', such as character-set, can be ignored. - if response['Content-Type'].split(';')[0] not in safe_mime_types: + mime_type = response.get('Content-Type', '').partition(';')[0] + if mime_type not in safe_mime_types: try: del response['Vary'] except KeyError: |
