def METHOD_NAME(self, send: Send, token: str, csrf_cookie: str | None) -> Send:
    """Wrap ``send`` to handle CSRF validation.
    Args:
        token: The CSRF token.
        send: The ASGI send function.
        csrf_cookie: CSRF cookie.
    Returns:
        An ASGI send function.
    """
    async def send_wrapper(message: Message) -> None:
        """Send function that wraps the original send to inject a cookie.
        Args:
            message: An ASGI ``Message``
        Returns:
            None
        """
        if csrf_cookie is None and message["type"] == "http.response.start":
            message.setdefault("headers", [])
            self._set_cookie_if_needed(message=message, token=token)
        await send(message)
    return send_wrapper