�
L�g� � �� � d dl mZ d dlZd dlZd dlZd dlZd dlZd dlm Z d dl
Z
d dlZ
d dlm
Z
d dlmZmZ d dlmZ d dlmZmZmZ d dlmZmZmZ ej ed f Z G d
� de� � Z G d� d
� � ZdS )� )�annotationsN)� parsedate)�get_route_path)�URL�Headers)�
HTTPException)�FileResponse�RedirectResponse�Response)�Receive�Scope�Sendzos.PathLike[str]c �$ � � e Zd ZdZd� fd�Z� xZS )�NotModifiedResponse)z
cache-controlzcontent-location�date�etag�expires�vary�headersr c � �� � t � � � d� fd�|� � � D � � �� � d S )Ni0 c �. �� i | ]\ }}|�j v �||��S � )�NOT_MODIFIED_HEADERS)�.0�name�value�selfs ��e/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/starlette/staticfiles.py�
<dictcomp>z0NotModifiedResponse.__init__.<locals>.<dictcomp># s, �� �i�i�i�[�T�5�t�t�Oh�Gh�Gh�T�5�Gh�Gh�Gh� )�status_coder )�super�__init__�items)r r � __class__s ` �r r# zNotModifiedResponse.__init__ sQ ��� �
������i�i�i�i�G�M�M�O�O�i�i�i� �
�
�
�
�
r )r r )�__name__�
__module__�__qualname__r r# �
__classcell__)r% s @r r r sE �� � � � � ���
�
�
�
�
�
�
�
�
�
r r c �n � e Zd Zdddddd�d-d�Z d.d/d�Zd0d�Zd1d�Zd2d�Zd3d�Z d4d5d'�Z d6d(�Z
d7d,�ZdS )8�StaticFilesNFT)� directory�packages�html� check_dir�follow_symlinkr, �PathLike | Noner- �"list[str | tuple[str, str]] | Noner. �boolr/ r0 �return�Nonec �� � || _ || _ | � ||� � | _ || _ d| _ || _ |r4|�4t j � |� � st d|� d�� � �d S d S d S )NF�Directory 'z' does not exist)r, r- �get_directories�all_directoriesr. �config_checkedr0 �os�path�isdir�RuntimeError)r r, r- r. r/ r0 s r r# zStaticFiles.__init__( s� � � #��� ��
�#�3�3�I�x�H�H����� �#���,���� J��.�r�w�}�}�Y�7O�7O�.��H�Y�H�H�H�I�I�I� J� J�.�.�.�.r �list[PathLike]c � � g }|�|� |� � |pg D ]�}t |t � � r|\ }}nd}t j � |� � }|�J d|�d�� � �|j �J d|�d�� � �t j � t j �
|j d|� � � � }t j � |� � sJ d|�d|�d�� � �|� |� � ��|S )z�
Given `directory` and `packages` arguments, return a list of all the
directories that should be used for serving static files from.
N�staticszPackage z could not be found.z..r7 z
' in package )�append�
isinstance�tuple� importlib�util� find_spec�originr; r<