diff options
Diffstat (limited to 'rest_framework/views.py')
| -rw-r--r-- | rest_framework/views.py | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/rest_framework/views.py b/rest_framework/views.py index 78010fa0..02a6e25a 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -112,11 +112,13 @@ class APIView(View):      @property      def default_response_headers(self): -        # TODO: Only vary by accept if multiple renderers -        return { +        headers = {              'Allow': ', '.join(self.allowed_methods), -            'Vary': 'Accept'          } +        if len(self.renderer_classes) > 1: +            headers['Vary'] = 'Accept' +        return headers +      def http_method_not_allowed(self, request, *args, **kwargs):          """ | 
