diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2011-12-11 08:58:14 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2011-12-11 08:58:14 +0000 |
| commit | affca1369c85116022e42d34f8deae245ce654cd (patch) | |
| tree | fc062c6eddca8521df83fc29e927fcc6a3c861e8 /django/http/utils.py | |
| parent | 545c3159f57ca110f1b60f1f82b672a3a1b95b2c (diff) | |
Fixed #16632 -- Crash on responses without Content-Type with IE. Thanks juan for the report and kenth for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17196 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/http/utils.py')
| -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: |
