OwlCyberSecurity - MANAGER
Edit File: fields.cpython-311.pyc
� ������h+����������������������������d�dl�mZ�d�dlZd�dlZd�dlZej��������eef���������Z ej��������e ej ��������ee f���������ej ��������ee ef���������f���������Z �ddd �Zdd �Z dd�Zdd�Zdd�Z�G�d��d������������ZdS�)�����)�annotationsN�application/octet-stream�filename� str | None�default�str�returnc�����������������B�����|�rt����������j��������|�������������d���������p|S�|S�)z� Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Content-Type" can be guessed, default to `default`. r���)� mimetypes� guess_type)r���r���s��� �E/opt/cloudlinux/venv/lib64/python3.11/site-packages/urllib3/fields.py�guess_content_typer������s,���������<��#�H�-�-�a�0�;�G�;��N������name�value�_TYPE_FIELD_VALUEc����������������������ddl�}|���������������������dt����������d��������������t�����������t����������������������r����������������������d�������������t �����������fd�dD���������������������������s7|���d ���d �} �|���������������������d�������������|S�#�t����������t����������f$�r�Y�nw�xY�wt����������j������������������������������d�������������|���d������S�) a��� Helper function to format and quote a single header parameter using the strategy defined in RFC 2231. Particularly useful for header parameters which might contain non-ASCII values, like file names. This follows `RFC 2388 Section 4.4 <https://tools.ietf.org/html/rfc2388#section-4.4>`_. :param name: The name of the parameter, a string expected to be ASCII only. :param value: The value of the parameter, provided as ``bytes`` or `str``. :returns: An RFC-2231-formatted unicode string. .. deprecated:: 2.0.0 Will be removed in urllib3 v2.1.0. This is not valid for ``multipart/form-data`` header parameters. r���Nz�'format_header_param_rfc2231' is deprecated and will be removed in urllib3 v2.1.0. This is not valid for multipart/form-data header parameters.������ stacklevel�utf-8c��������������3��� ����K����|�]}|�v�V���� d�S��N��)�.0�chr���s��� �r ���� <genexpr>z.format_header_param_rfc2231.<locals>.<genexpr>@���s'�����������/�/�r�r�U�{�/�/�/�/�/�/r���z"\ �="�"�asciiz*=) �warnings�warn�DeprecationWarning� isinstance�bytes�decode�any�encode�UnicodeEncodeError�UnicodeDecodeError�email�utils�encode_rfc2231)r���r���r!����results��� ` r ����format_header_param_rfc2231r/������s ������(��O�O�O��M�M� 1�� ������������%�����&����W�%�%���/�/�/�/�Y�/�/�/�/�/����$�$�E�$�$�$�� ��M�M�'�"�"�"���M���#�$6�7�� �� �� ��D� ���� � �K�&�&�u�g�6�6�E����u���E��Ls����1B��B�Bc����������������������t����������|t����������������������r|���������������������d������������}|���������������������dddd�������������}|���d|��d�S�)a��� Format and quote a single multipart header parameter. This follows the `WHATWG HTML Standard`_ as of 2021/06/10, matching the behavior of current browser and curl versions. Values are assumed to be UTF-8. The ``\n``, ``\r``, and ``"`` characters are percent encoded. .. _WHATWG HTML Standard: https://html.spec.whatwg.org/multipage/ form-control-infrastructure.html#multipart-form-data :param name: The name of the parameter, an ASCII-only ``str``. :param value: The value of the parameter, a ``str`` or UTF-8 encoded ``bytes``. :returns: A string ``name="value"`` with the escaped value. .. versionchanged:: 2.0.0 Matches the WHATWG HTML Standard as of 2021/06/10. Control characters are no longer percent encoded. .. versionchanged:: 2.0.0 Renamed from ``format_header_param_html5`` and ``format_header_param``. The old names will be removed in urllib3 v2.1.0. r���z%0Az%0Dz%22)� ���� ����"���r���r���)r$���r%���r&���� translate)r���r���s��� r ����format_multipart_header_paramr5���O���s[������<��%�����&����W�%�%��� �O�O��E�u�=�=�>�>�E����e����r���c�����������������d�����ddl�}|���������������������dt����������d��������������t����������|�|������������S�)�� .. deprecated:: 2.0.0 Renamed to :func:`format_multipart_header_param`. Will be removed in urllib3 v2.1.0. r���Nz�'format_header_param_html5' has been renamed to 'format_multipart_header_param'. The old name will be removed in urllib3 v2.1.0.r���r����r!���r"���r#���r5����r���r���r!���s��� r ����format_header_param_html5r:���u����G��������O�O�O��M�M� %�� �����������)��u�5�5�5r���c�����������������d�����ddl�}|���������������������dt����������d��������������t����������|�|������������S�)r7���r���Nzz'format_header_param' has been renamed to 'format_multipart_header_param'. The old name will be removed in urllib3 v2.1.0.r���r���r8���r9���s��� r ����format_header_paramr=�������r;���r���c�������������������f�����e�Zd�ZdZ � � �ddd �Ze �dd d���������������Zd!d�Zd"d�Zd#d�Z � � �dd$d�Z dS�)%�RequestFielda��� A data container for request body parameters. :param name: The name of this request field. Must be unicode. :param data: The data/value body. :param filename: An optional filename of the request field. Must be unicode. :param headers: An optional dict-like object of headers to initially use for the field. .. versionchanged:: 2.0.0 The ``header_formatter`` parameter is deprecated and will be removed in urllib3 v2.1.0. Nr���r����datar���r���r����headers�typing.Mapping[str, str] | None�header_formatter�5typing.Callable[[str, _TYPE_FIELD_VALUE], str] | Nonec�����������������������||�_���������||�_��������||�_��������i�|�_��������|rt ����������|������������|�_��������|�*dd�l}|���������������������dt����������d��������������||�_��������d�S�t����������|�_��������d�S�)Nr���zUThe 'header_formatter' parameter is deprecated and will be removed in urllib3 v2.1.0.r���r���) �_name� _filenamer@���rA����dictr!���r"���r#���rC���r5���)�selfr���r@���r���rA���rC���r!���s��� r ����__init__zRequestField.__init__����s���������� �!����� �.0����� )���=�=�D�L��'��O�O�O��M�M�5�"�� � �� �� �� ��%5�D�!�!�!�$A�D�!�!�!r���� fieldnamer����_TYPE_FIELD_VALUE_TUPLEr ���c���������������������t����������|t����������������������r�t����������|������������dk����r<t����������j��������t����������j��������t����������t����������t����������f���������|������������\��}}}nJt����������j��������t����������j��������t����������t����������f���������|������������\��}}t����������|������������}nd}d}|}�|�||||�������������}|� ��������������������|��������������|S�)a��� A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters. Supports constructing :class:`~urllib3.fields.RequestField` from parameter of key/value strings AND key/filetuple. A filetuple is a (filename, data, MIME type) tuple where the MIME type is optional. For example:: 'foo': 'bar', 'fakefile': ('foofile.txt', 'contents of foofile'), 'realfile': ('barfile.txt', open('realfile').read()), 'typedfile': ('bazfile.bin', open('bazfile').read(), 'image/jpeg'), 'nonamefile': 'contents of nonamefile field', Field names and filenames must be unicode. ����N)r���rC���)�content_type) r$����tuple�len�typing�cast�Tupler���r���r����make_multipart)�clsrK���r���rC���r���r@���rO���� request_params��� r ����from_tupleszRequestField.from_tuples����s�������6��e�U�#�#�� ��5�z�z�Q���/5�{��L��&7��!<�=�u�0��0�,��$����"(���L��&7�!7�8�%�"��"���$�� 2�(�;�;����H��L��D����t�h�AQ� �� �� � �� �$�$�,�$�?�?�?��r���c�����������������.�����|�����������������������||������������S�)a��� Override this method to change how each multipart header parameter is formatted. By default, this calls :func:`format_multipart_header_param`. :param name: The name of the parameter, an ASCII-only ``str``. :param value: The value of the parameter, a ``str`` or UTF-8 encoded ``bytes``. :meta public: )rC���)rI���r���r���s��� r ����_render_partzRequestField._render_part����s��������$�$�T�5�1�1�1r����header_parts�[dict[str, _TYPE_FIELD_VALUE | None] | typing.Sequence[tuple[str, _TYPE_FIELD_VALUE | None]]c�����������������������g�}t����������|t����������������������r|�����������������������������������}n|}|D�]0\��}}|�)|���������������������|����������������������||��������������������������1d���������������������|������������S�)aO�� Helper function to format and quote a single header. Useful for single headers that are composed of multiple items. E.g., 'Content-Disposition' fields. :param header_parts: A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format as `k1="v1"; k2="v2"; ...`. N�; )r$���rH����items�appendrZ����join)rI���r[����parts�iterabler���r���s��� r ���� _render_partszRequestField._render_parts��s�������&����l�D�)�)�� $�#�)�)�+�+�H�H�#�H�#�� =�� =�K�D�%�� ����T�.�.�t�U�;�;�<�<�<���y�y����r���c�����������������j����g�}g�d�}|D�]B}|�j������������������������������|d������������r%|���������������������|��d|�j���������|��������������������������C|�j��������������������������������������������D�]%\��}}||vr|r|���������������������|��d|�����������������&|���������������������d�������������d���������������������|������������S�)z= Renders the headers for this request field. )�Content-Disposition�Content-Type�Content-LocationFz: z )rA����getr`���r_���ra���)rI����lines� sort_keys�sort_key�header_name�header_values��� r ����render_headerszRequestField.render_headers'��s����������O�O�O� �!�� F�� F�H��|����%�0�0�� F�����D�D�D�L��,B�D�D�E�E�E��)-��);�);�)=�)=�� C�� C�%�K���)�+�+���C��L�L�K�!A�!A�<�!A�!A�B�B�B�� ���V�����{�{�5�!�!�!r����content_dispositionrO����content_location�Nonec����������� �����������|pdd����������������������d|����������������������d|�j��������fd|�j��������ff������������g������������z���}||�j��������d<���||�j��������d<���||�j��������d<���d S�) a��� Makes this request field into a multipart request field. This method overrides "Content-Disposition", "Content-Type" and "Content-Location" headers to the request parameter. :param content_disposition: The 'Content-Disposition' of the request body. Defaults to 'form-data' :param content_type: The 'Content-Type' of the request body. :param content_location: The 'Content-Location' of the request body. z form-datar^�����r���r���rf���rg���rh���N)ra���rd���rF���rG���rA���)rI���rp���rO���rq���s��� r ���rU���zRequestField.make_multipart:��s�������(� 3�A�k�T�Y�Y���"�"��d�j�)�J���+G�H���� �F ��F �� ���/B���*�+�'3���^�$�+;���'�(�(�(r���)NNN) r���r���r@���r���r���r���rA���rB���rC���rD���r���)rK���r���r���rL���rC���rD���r ���r?����r���r���r���r���r ���r���)r[���r\���r ���r���)r ���r���)rp���r���rO���r���rq���r���r ���rr���)�__name__� __module__�__qualname__�__doc__rJ����classmethodrX���rZ���rd���ro���rU���r���r���r ���r?���r?�������s������������������*� $�37�RV� B��B��B��B��B�8�� �SW� .��.��.��.���[�.�`2��2��2��2� �� �� �� �>"��"��"��"�*�+/�#'�'+� <��<��<��<��<��<��<r���r?���)r���)r���r���r���r���r ���r���ru���)� __future__r����email.utilsr+���r���rR����Unionr���r%���r���rT���rL���r���r/���r5���r:���r=���r?���r���r���r ����<module>r~������s-�����"��"��"��"��"��"������������������ � � � ��L��e��,��� �,�� �L��'�'�(� �L��'��,�-�/�����*D� �� �� �� �� � -��-��-��-�`#��#��#��#�L6��6��6��6�$6��6��6��6�$@<��@<��@<��@<��@<��@<��@<��@<��@<��@<r���