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
840fe7b0
Commit
840fe7b0
authored
Sep 03, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1706 from pipermerriam/piper/use_decorator_mixin_class
Alter CSRF exemption implementation
parents
415b33b4
fc9be55d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
rest_framework/views.py
+6
-4
No files found.
rest_framework/views.py
View file @
840fe7b0
...
@@ -103,7 +103,9 @@ class APIView(View):
...
@@ -103,7 +103,9 @@ class APIView(View):
"""
"""
view
=
super
(
APIView
,
cls
)
.
as_view
(
**
initkwargs
)
view
=
super
(
APIView
,
cls
)
.
as_view
(
**
initkwargs
)
view
.
cls
=
cls
view
.
cls
=
cls
return
view
# Note: session based authentication is explicitly CSRF validated,
# all other authentication is CSRF exempt.
return
csrf_exempt
(
view
)
@property
@property
def
allowed_methods
(
self
):
def
allowed_methods
(
self
):
...
@@ -371,9 +373,9 @@ class APIView(View):
...
@@ -371,9 +373,9 @@ class APIView(View):
response
.
exception
=
True
response
.
exception
=
True
return
response
return
response
# Note:
session based authentication is explicitly CSRF validated,
# Note:
Views are made CSRF exempt from within `as_view` as to prevent
# a
ll other authentication is CSRF exempt.
# a
ccidental removal of this exemption in cases where `dispatch` needs to
@csrf_exempt
# be overridden.
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
"""
"""
`.dispatch()` is pretty much the same as Django's regular dispatch,
`.dispatch()` is pretty much the same as Django's regular dispatch,
...
...
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