diff options
| -rw-r--r-- | rest_framework/tests/generics.py | 4 | ||||
| -rw-r--r-- | rest_framework/views.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/rest_framework/tests/generics.py b/rest_framework/tests/generics.py index 014195ae..d8556638 100644 --- a/rest_framework/tests/generics.py +++ b/rest_framework/tests/generics.py @@ -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': '', diff --git a/rest_framework/views.py b/rest_framework/views.py index 719df428..c5b89a02 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -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) |
