Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
c71b6fb0
Commit
c71b6fb0
authored
Jan 11, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace 'x.has_key(y)' with 'y in x'
parent
ed8b296e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
djangorestframework/mixins.py
+3
-3
No files found.
djangorestframework/mixins.py
View file @
c71b6fb0
...
...
@@ -281,13 +281,13 @@ class ResponseMixin(object):
# Use _accept parameter override
accept_list
=
[
request
.
GET
.
get
(
self
.
_ACCEPT_QUERY_PARAM
)]
elif
(
self
.
_IGNORE_IE_ACCEPT_HEADER
and
request
.
META
.
has_key
(
'HTTP_USER_AGENT'
)
and
'HTTP_USER_AGENT'
in
request
.
META
and
MSIE_USER_AGENT_REGEX
.
match
(
request
.
META
[
'HTTP_USER_AGENT'
])):
# Ignore MSIE's broken accept behavior and do something sensible instead
accept_list
=
[
'text/html'
,
'*/*'
]
elif
request
.
META
.
has_key
(
'HTTP_ACCEPT'
)
:
elif
'HTTP_ACCEPT'
in
request
.
META
:
# Use standard HTTP Accept negotiation
accept_list
=
[
token
.
strip
()
for
token
in
request
.
META
[
"HTTP_ACCEPT"
]
.
split
(
','
)]
accept_list
=
[
token
.
strip
()
for
token
in
request
.
META
[
'HTTP_ACCEPT'
]
.
split
(
','
)]
else
:
# No accept header specified
accept_list
=
[
'*/*'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment