Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
headers.cpython-313.pyc38 linesDownload Raw Back to __pycache__
1�

2��jn�	�b�SSKrSSKrS\S\\\\\\44S-4SjrSrS	S\S\S\4Sjjrg)3�N�c�returnc���URSS5nUSRSS5n[U5S:wag[R"5n[U5S:XadUSRS5HLnURSS5n[U5S:XdM&USR	5X5SR	5'MN USR5USR5U4$)a54A simple parser for content-type values. Returns a (type, subtype,5parameters) tuple, where type and subtype are strings, and parameters6is a dict. If the string could not be parsed, return None.7 8E.g. the following string:9 10    text/html; charset=UTF-811 12Returns:13 14    ("text", "html", {"charset": "UTF-8"})15�;�r�/�N�=)�split�len�collections�OrderedDict�strip�lower)r�parts�ts�d�i�clauses      �`D:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/net/http/headers.py�parse_content_typers���
�G�G�C��O�E�	�q�����Q�	�B�16�2�w�!�|�����!�A�17�5�z�Q���q�����$�A��W�W�S�!�_�F��6�{�a��'-�a�y���'8���)�/�/�#�$�%��a�5�;�;�=�"�Q�%�+�+�-��*�*�c�~�U(dUSU3$SRSUR555nUSUSU3$)Nrz; c3�4# �UHupUSU3v� M g7f)r18N�)�.0�k�vs   r�	<genexpr>�(assemble_content_type.<locals>.<genexpr>#s���A�.@�d�a�!��A�a�S�z�.@�s�)�join�items)�type�subtype�19parameters�paramss    r�assemble_content_typer' sJ�����q��	�"�"�
�Y�Y�A�j�.>�.>�.@�A�
A�F��V�1�W�I�R��x�(�(r�content_type�contentc�20�SnURS5(aSnO�URS5(aSnOqURS5(aSnOXURS5(aS	nO?URS215(aSnO&[U5=n(aUSRS
5nU(dSU;aSnU(dWSU;aQ[R"SU[R225nU(a"UR
S5RSS5nOSnU(dWSU;aQ[R"SU[R235=n(a"UR
S5RSS5nOSnU(dSU;dSU;aSnU(dWSU;aQ[R"SU[R245nU(a"UR
S5RSS5nOSnU(dSnUR5S;aSnU$)z=25Infer the encoding of content from the content-type header.26Ns��zutf-32bes��zutf-32les��zutf-16bes��zutf-16lesz	utf-8-sigr	�charset�json�utf8�htmls <meta[^>]+charset=['"]?([^'">]+)r�ascii�ignore�xmls%<\?xml[^\?>]+encoding=['"]([^'"\?>]+)�27javascript�28ecmascriptztext/csss@charset "([^"]+)";zlatin-1)�gb2312�gbk�gb18030)29�30startswithr�get�re�search�31IGNORECASE�group�decode�matchr)r(r)�enc�parsed_content_type�meta_charset�xml_encoding�css_charsets       r�infer_content_encodingrD's����C����-�.�.���	�	�	�/�	0�	0���	�	�	�K�	(�	(���	�	�	�K�	(�	(���	�	�	�O�	,�	,��� 2�<� @�	@�	�	@�!�!�$�(�(��3���6�\�)����6�\�)��y�y�4�g�r�}�}�32����$�$�Q�'�.�.�w��A�C�33�C��5�L�(��9�9�9�7�B�M�M�34�35�<�36��$�$�Q�'�.�.�w��A�C�37�C��L�L�0�L�L�4P����:��-��h�h�:�G�R�]�]�S����#�#�A�&�-�-�g�x�@�C�38�C�����y�y�{�'�'����Jr)r)	r
r9�str�tuple�dictrr'�bytesrDrrr�<module>rIsZ���	�+�#�+�%��S�$�s�C�x�.�(@�"A�D�"H�+�6)�J��J�u�J�s�Jr
codekingpro/portable-devtools · Team Ai