a
    a *jJ  ã                   @   s0   d dl mZ eedœdd„Zeedœdd„ZdS )é    )ÚRequest)ÚrequestÚreturnc                 C   s2   d| j v r| j d S | jr"| jjs&dS | jjS dS )a  
    Returns the ip address for the current request (or 127.0.0.1 if none found)
     based on the X-Forwarded-For headers.
     Note that a more robust method for determining IP address of the client is
     provided by uvicorn's ProxyHeadersMiddleware.
    ZX_FORWARDED_FORú	127.0.0.1N)ÚheadersÚclientÚhost©r   © r
   úH/var/www/html/assistant/venv/lib/python3.9/site-packages/slowapi/util.pyÚ
get_ipaddr   s
    

r   c                 C   s   | j r| j jsdS | j jS )zU
    Returns the ip address for the current request (or 127.0.0.1 if none found)
    r   )r   r   r	   r
   r
   r   Úget_remote_address   s    r   N)Zstarlette.requestsr   Ústrr   r   r
   r
   r
   r   Ú<module>   s   