Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
web_middlewares.cpython-313.pyc47 linesDownload Raw Back to __pycache__
1�

2��j����SSKrSSKJrJrJrJr SSKJrJr SSK	J3r4Jr SSKJ
r
 SSKJr SSKJr S	r\(aSS5KJr \"S5rS\
S
\S\\\
44SjrS\S\4SjrSSS\S.S\S\S\S\\6S\47SjjrSSS\4Sjrg)�N)�
TYPE_CHECKING�Tuple�Type�TypeVar�)�Handler�8Middleware)�HTTPMove�HTTPPermanentRedirect)�Request)�StreamResponse)�SystemRoute)�9middleware�normalize_path_middleware)�Application�_Func�request�path�returnc��# �URUS9nURRRU5IShv�NnX2lUR10cSU4$SU4$N7f)N)�rel_urlTF)�clone�app�router�resolve�_match_info�http_exception)rr�alt_request�11match_infos    �]D:\code\apps\devtools\python\user_packages\Python313\site-packages\aiohttp/web_middlewares.py�_check_request_resolvesr!s^����-�-��-�-�K��{�{�)�)�1�1�+�>�>�J�(��� � �(��[� � ��'�>��
?�s�8A�A� A�fc��SUlU$)Nr)�__middleware_version__)r"s r rr!s�� �A���H�TF)�append_slash�remove_slash�
merge_slashes�redirect_classr&r'r(r)c�^^^^�T=(a T(+nU(dS5e[S[S[S[4UUUU4Sjj5nU$)a,Factory for producing a middleware that normalizes the path of a request.12 13Normalizing means:14    - Add or remove a trailing slash to the path.15    - Double slashes are replaced by one.16 17The middleware returns as soon as it finds a path that resolves18correctly. The order if both merge and append/remove are enabled is19    1) merge slashes20    2) append/remove slash21    3) both merge slashes and append/remove slash.22If the path resolves with at least one of those conditions, it will23redirect to the new path.24 25Only one of `append_slash` and `remove_slash` can be enabled. If both26are `True` the factory will raise an assertion error27 28If `append_slash` is `True` the middleware will append a slash when29needed. If a resource is defined with trailing slash and the request30comes without it, it will append it automatically.31 32If `remove_slash` is `True`, `append_slash` must be `False`. When enabled33the middleware will remove trailing slashes and redirect if the resource34is defined35 36If merge_slashes is True, merge multiple consecutive slashes in the37path into one.38z#Cannot both remove and append slashr�handlerrc���># �[URR[5(Ga�/nSUR;a$URRSS5up4SU-nOSnURnT(a'UR
[R"SSU55 T(a4URRS5(dUR
US-5 T39(a4URRS5(aUR
USS5 T(a1T(a*UR
[R"SSUS-55 T(a3T40(a,[R"SSU5nUR
USS5 UHLn[R"SSU5n[X5IShv�Nup`U(dM9T	"URU-5e U"U5IShv�N$N6N7f)N�?r�z//+�/�����z^//+)�41isinstancer�router�raw_path�split�append�re�subr�endswithr!)rr+�paths_to_checkr�query�merged_slashes�resolvesr&r(r)r's       ����r �impl�'normalize_path_middleware.<locals>.implLs������g�(�(�.�.��<�<��N��g�&�&�&�%�.�.�4�4�S�!�<����e������'�'����%�%�b�f�f�U�C��&>�?��G�L�L�$9�$9�#�$>�$>��%�%�d�S�j�1����� 5� 5�c� :� :��%�%�d�3�B�i�0����%�%�b�f�f�U�C����&D�E���!#����s�D�!9���%�%�n�S�b�&9�:�&���v�v�f�c�4�0��*A�'�*P�$P�!���8�(��)9�)9�E�)A�B�B�	'��W�%�%�%�	%Q�&�s*�F0G.�3G*�4G.�"G.�%G,�&G.�,G.�rrrr
)r&r'r(r)�correct_configurationr=s````  r rr&sV���F".�!>�,�?�� �G�"G�G� ��&�G�&�g�&�.�&�&��&�<�Kr%rrc�N^�[S[S[S[4U4Sjj5nU$)Nrr+rc��># �URnURnTUlU"U5IShv�NX2l$N42!X2lf=f7f)N)r�current_app)rr+r�prevrs    �r r=�&_fix_request_current_app.<locals>.implosF�����'�'�43��%�%��!$�44��	*� ��)�)�%)�"�*��%)�"�s%� A�<�:�<�A�<�A�Ar?)rr=s` r �_fix_request_current_apprFns1����*�G�*�g�*�.�*��*��Kr%)r6�typingrrrr�typedefsrr	�web_exceptionsr45r�web_requestr�web_responser
�web_urldispatcherr�__all__�web_apprr�str�boolr!rrrF�r%r �<module>rRs���	�6�6�)�;� �(�*���46�$�����	�7�	�#�	�%��g�
�BV�	�
�%�
�E�
����%:�E��E��E��	E�47��N�E��
E�P�-��J�r%
codekingpro/portable-devtools · Team Ai