INNER CODE UNIT · Python

_check_request_limit

laurentS/slowapi · slowapi/extension.py:555

    def _check_request_limit(
        self,
        request: Request,
        endpoint_func: Optional[Callable[..., Any]],
        in_middleware: bool = True,
    ) -> None:
        """
        Determine if the request is within limits
        """
        endpoint_url = request["path"] or ""
        view_func = endpoint_func

        endpoint_func_name = (
            f"{view_func.__module__}.{view_func.__name__}" if view_func else ""
        )
        _endpoint_key = endpoint_url if self._key_style == "url" else endpoint_func_name
        # cases where we don't need to check the limits
        if (

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…