'Return a list of the valid HTTP methods for this endpoint.'

def get_allowed_methods(self, callback):

    if hasattr(callback, 'actions'):
        actions = set(callback.actions.keys())
        http_method_names = set(callback.cls.http_method_names)
        return [method.upper() for method in (actions & http_method_names)]
    return [method for method in callback.cls().allowed_methods if (method not in ('OPTIONS', 'HEAD'))]
