HEAD and OPTIONS should not be exposed as actions as discussed in a42afa04c3 (commitcomment-3241476)

This commit is contained in:
Nikolaus Schlemm 2013-05-18 17:38:47 +02:00
parent b225b1d5c9
commit 5ab7cc6e6b
2 changed files with 6 additions and 2 deletions

View File

@ -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': '',

View File

@ -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)