  
      def is_allowed_version(self, version):
          if not self.allowed_versions:
              return True
          return (version == self.default_version) or (version in self.allowed_versions)
  
  
  class AcceptHeaderVersioning(BaseVersioning):
      """
      GET /something/ HTTP/1.1
 
</s> remove class RequestInvalidVersionView(APIView):
 </s> add class AllowedVersionsView(RequestVersionView): </s> remove     def get(self, request, *args, **kwargs):
        return Response({'version': request.version})
 </s> add class AllowedAndDefaultVersionsView(RequestVersionView):
    def determine_version(self, request, *args, **kwargs):
        scheme = self.versioning_class()
        scheme.allowed_versions = ('v1', 'v2')
        scheme.default_version = 'v2'
        return (scheme.determine_version(request, *args, **kwargs), scheme)


class AllowedWithNoneVersionsView(RequestVersionView):
    def determine_version(self, request, *args, **kwargs):
        scheme = self.versioning_class()
        scheme.allowed_versions = ('v1', 'v2', None)
        return (scheme.determine_version(request, *args, **kwargs), scheme)


class AllowedWithNoneAndDefaultVersionsView(RequestVersionView):
    def determine_version(self, request, *args, **kwargs):
        scheme = self.versioning_class()
        scheme.allowed_versions = ('v1', 'v2', None)
        scheme.default_version = 'v2'
        return (scheme.determine_version(request, *args, **kwargs), scheme) </s> remove         view = RequestInvalidVersionView.as_view(versioning_class=scheme)
 </s> add         view = AllowedVersionsView.as_view(versioning_class=scheme) </s> remove         view = RequestInvalidVersionView.as_view(versioning_class=scheme)
 </s> add         view = AllowedVersionsView.as_view(versioning_class=scheme) </s> remove         view = RequestInvalidVersionView.as_view(versioning_class=scheme)
 </s> add         view = AllowedVersionsView.as_view(versioning_class=scheme)
        return ((version is not None and version == self.default_version) or
                (version in self.allowed_versions))
  
      def is_allowed_version(self, version):
          if not self.allowed_versions:
              return True
        return ((version is not None and version == self.default_version) or
                (version in self.allowed_versions))
  
  
  class AcceptHeaderVersioning(BaseVersioning):
      """
      GET /something/ HTTP/1.1
keep keep keep keep replace keep keep keep keep keep
 Fix handling of ALLOWED_VERSIONS and no DEFAULT_VERSION (#4370)

When only `ALLOWED_VERSIONS` but no `DEFAULT_VERSION` is specified, a
version should be enforced. 
rest_framework/versioning.py