aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/mixins.py
diff options
context:
space:
mode:
authorTom Christie2012-08-24 16:06:23 +0100
committerTom Christie2012-08-24 16:06:23 +0100
commit7557777c668e6b8eaa85b07971b94115a33c9358 (patch)
tree6bd152248eb1e535b86fbc4396fe16fa644a0d2f /djangorestframework/mixins.py
parent2d2e2f95b0268c3282edfca5c047bdc831133016 (diff)
parentdb7d15d5d136a9b4dcf759f9d588006244bd4e91 (diff)
downloaddjango-rest-framework-7557777c668e6b8eaa85b07971b94115a33c9358.tar.bz2
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
Diffstat (limited to 'djangorestframework/mixins.py')
-rw-r--r--djangorestframework/mixins.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py
index 6c8f8179..4a453957 100644
--- a/djangorestframework/mixins.py
+++ b/djangorestframework/mixins.py
@@ -181,7 +181,7 @@ class RequestMixin(object):
return parser.parse(stream)
raise ErrorResponse(status.HTTP_415_UNSUPPORTED_MEDIA_TYPE,
- {'error': 'Unsupported media type in request \'%s\'.' %
+ {'detail': 'Unsupported media type in request \'%s\'.' %
content_type})
@property
@@ -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: