mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
HEAD and OPTIONS should not be exposed as actions as discussed in a42afa04c3 (commitcomment-3241476)
This commit is contained in:
parent
b225b1d5c9
commit
5ab7cc6e6b
|
@ -125,7 +125,7 @@ class TestRootView(TestCase):
|
|||
'actions': {}
|
||||
}
|
||||
# TODO: this is just a draft for fields' metadata - needs review and decision
|
||||
for method in ('HEAD', 'GET', 'POST', 'OPTIONS'):
|
||||
for method in ('GET', 'POST',):
|
||||
expected['actions'][method] = {
|
||||
'text': {
|
||||
'description': '',
|
||||
|
@ -261,7 +261,7 @@ class TestInstanceView(TestCase):
|
|||
'actions': {}
|
||||
}
|
||||
# TODO: this is just a draft idea for fields' metadata - needs review and decision
|
||||
for method in ('HEAD', 'GET', 'PATCH', 'PUT', 'OPTIONS', 'DELETE'):
|
||||
for method in ('GET', 'PATCH', 'PUT', 'DELETE'):
|
||||
expected['actions'][method] = {
|
||||
'text': {
|
||||
'description': '',
|
||||
|
|
|
@ -71,6 +71,10 @@ class APIView(View):
|
|||
actions = {}
|
||||
|
||||
for method in self.allowed_methods:
|
||||
# skip HEAD and OPTIONS
|
||||
if method in ('HEAD', 'OPTIONS'):
|
||||
continue
|
||||
|
||||
cloned_request = clone_request(request, method)
|
||||
try:
|
||||
self.check_permissions(cloned_request)
|
||||
|
|
Loading…
Reference in New Issue
Block a user