diff options
| author | Adam Ness | 2012-07-02 20:32:42 -0700 |
|---|---|---|
| committer | Adam Ness | 2012-07-02 20:39:56 -0700 |
| commit | 73be041c474900423c5258b57b3d71d566aea6df (patch) | |
| tree | 8f5e466589b54c349a1b582597bd83eb17fa9383 /djangorestframework/mixins.py | |
| parent | 11147ce13e754f47b9cdc8d0de8a071aa540882f (diff) | |
| download | django-rest-framework-73be041c474900423c5258b57b3d71d566aea6df.tar.bz2 | |
Patch to enable Accept headers in Internet Explorer when an Ajax Library on the client (i.e. jQuery) is sending an XMLHttpRequest
Diffstat (limited to 'djangorestframework/mixins.py')
| -rw-r--r-- | djangorestframework/mixins.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py index 6c8f8179..0f292b4e 100644 --- a/djangorestframework/mixins.py +++ b/djangorestframework/mixins.py @@ -274,7 +274,8 @@ class ResponseMixin(object): accept_list = [request.GET.get(self._ACCEPT_QUERY_PARAM)] elif (self._IGNORE_IE_ACCEPT_HEADER and 'HTTP_USER_AGENT' in request.META and - MSIE_USER_AGENT_REGEX.match(request.META['HTTP_USER_AGENT'])): + MSIE_USER_AGENT_REGEX.match(request.META['HTTP_USER_AGENT']) and + request.META.get('HTTP_X_REQUESTED_WITH', '') != 'XMLHttpRequest'): # Ignore MSIE's broken accept behavior and do something sensible instead accept_list = ['text/html', '*/*'] elif 'HTTP_ACCEPT' in request.META: |
