Sindbad~EG File Manager
�
'ٜg� � � � d dl mZ d dlZd dlmZ ddlmZ ddlm Z ddl
mZ dd�Z d
dd �Z
d dd
�Z d
dd�Zy)� )�annotationsN)�quote� )�
_plain_int)�
SecurityError)�
uri_to_iric � � | sy | j d� d j d� j d� } t |t
� r|g}|D ]n }|j
d� r|dd }d }nd} |j d� d j d� j d� }|| k( s|s�Y| j d|� �� s�n y y# t $ r Y yw xY w# t $ r Y yw xY w)
z�Check if a host matches a list of trusted names.
:param hostname: The name to check.
:param trusted_list: A list of valid names to match. If a name
starts with a dot it will match all subdomains.
.. versionadded:: 0.9
F�:r �idna�ascii�.� NT)� partition�encode�decode�UnicodeEncodeError�
isinstance�str�
startswith�endswith)�hostname�trusted_list�ref�suffix_matchs �@/usr/local/lib/python3.12/site-packages/werkzeug/sansio/utils.py�host_is_trustedr s� � � ����%�%�c�*�1�-�4�4�V�<�C�C�G�L�� �,��$�$�~�����>�>�#���a�b�'�C��L� �L� ��-�-��$�Q�'�.�.�v�6�=�=�g�F�C� �(�?�|��0A�0A�A�c�U�)�0L�� � ��+ � ���� "� �� �s# �2B>