Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/dispatcher.cpython-312.pyc

�

'ٜg*
��l�dZddlmZddlZej
rddlmZddlmZddlm	Z	Gd�d�Z
y)	aY
Application Dispatcher
======================

This middleware creates a single WSGI application that dispatches to
multiple other WSGI applications mounted at different URL paths.

A common example is writing a Single Page Application, where you have a
backend API and a frontend written in JavaScript that does the routing
in the browser rather than requesting different pages from the server.
The frontend is a single HTML and JS file that should be served for any
path besides "/api".

This example dispatches to an API app under "/api", an admin app
under "/admin", and an app that serves frontend files for all other
requests::

    app = DispatcherMiddleware(serve_frontend, {
        '/api': api_app,
        '/admin': admin_app,
    })

In production, you might instead handle this at the HTTP server level,
serving files or proxying to application servers based on location. The
API and admin apps would each be deployed with a separate WSGI server,
and the static files would be served directly by the HTTP server.

.. autoclass:: DispatcherMiddleware

:copyright: 2007 Pallets
:license: BSD-3-Clause
�)�annotationsN)�
StartResponse)�WSGIApplication)�WSGIEnvironmentc�:�eZdZdZ	d					dd�Z						dd�Zy)�DispatcherMiddlewareaJCombine multiple applications as a single WSGI application.
    Requests are dispatched to an application based on the path it is
    mounted under.

    :param app: The WSGI application to dispatch to if the request
        doesn't match a mounted path.
    :param mounts: Maps path prefixes to applications for dispatching.
    Nc�(�||_|xsi|_y�N)�app�mounts)�selfrrs   �I/usr/local/lib/python3.12/site-packages/werkzeug/middleware/dispatcher.py�__init__zDispatcherMiddleware.__init__6s��
����l����c�L�|jdd�}d}d|vr?||jvr|j|}nG|jdd�\}}d|�|��}d|vr�?|jj||j�}|jdd�}||z|d<||d<|||�S)N�	PATH_INFO��/��SCRIPT_NAME)�getr�rsplitr)r
�environ�start_response�script�	path_infor�	last_item�original_script_names        r�__call__zDispatcherMiddleware.__call__>s������[�"�-���	��V�m�����$��k�k�&�)��� &�
�
�c�1� 5��F�I��I�;�y�k�2�I�
�V�m��+�+�/�/�&�$�(�(�3�C�&�{�{�=�"�=��!5��!>��
��(�����7�N�+�+rr
)rrrz!dict[str, WSGIApplication] | None�return�None)rrrrr zt.Iterable[bytes])�__name__�
__module__�__qualname__�__doc__rr�rrrr,sJ���59�#�
�#�2�#�
�	#�,�&�,�8E�,�	�,rr)r%�
__future__r�typing�t�
TYPE_CHECKING�_typeshed.wsgirrrrr&rr�<module>r,s-���B#���?�?�,�.�.�%,�%,r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists