/opt/imunify360/venv/lib/python3.11/site-packages/urllib3/__pycache__
Edit: /opt/imunify360/venv/lib/python3.11/site-packages/urllib3/__pycache__/fields.cpython-311.pyc (11399B)
]j! d dl mZ d dlZd dlZd dlZddlmZ ddZd Z dd d
Z
e
d ed d D d
Z
d ZeZ G d de ZdS ) )absolute_importN )sixapplication/octet-streamc 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)filenamedefaults E/opt/imunify360/venv/lib64/python3.11/site-packages/urllib3/fields.pyguess_content_typer
s, <#H--a0;G;N c t t j r d t fddD s7| dd} | d |S # t t f$ r Y nw xY wt j r d t j
d | dt j r 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
`_.
: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``.
:ret:
An RFC-2231-formatted unicode string.
utf-8c 3 K | ]}|v V d S N ).0chvalues r z.format_header_param_rfc2231..+ s' //rrU{//////r z"\
=""asciiz*=)
isinstancer binary_typedecodeanyencodeUnicodeEncodeErrorUnicodeDecodeErrorPY2emailutilsencode_rfc2231)namer results ` r format_header_param_rfc2231r( s
%)) &W%%////Y///// #ttUUU+ MM'""" M #$67 D
w &W%%
K&&ug66Eee$E
w &W%%Ls A, ,B ?B z%22z\\)r \c f i | ].}|d vt j | d | /S )) z%{:02X})r unichrformat)r ccs r
r/ J sE
W
2
))"--r c fd}t j d d D }| || }|S )Nc : | d S )Nr )group)matchneedles_and_replacementss r replacerz#_replace_multiple..replacerS s 'A77r |c 6 g | ]}t j | S r )reescape)r needles r
z%_replace_multiple..W s" SSS29V$$SSSr )r9 compilejoinkeyssub)r r5 r6 patternr' s ` r _replace_multiplerB R st 8 8 8 8 8 j SS3K3P3P3R3RSSSTT G [[5
)
)FMr c t |t j r| d }t |t
}| d|dS )a
Helper function to format and quote a single header parameter using the
HTML5 strategy.
Particularly useful for header parameters which might contain
non-ASCII values, like file names. This follows the `HTML5 Working Draft
Section 4.10.22.7`_ and matches the behavior of curl and modern browsers.
.. _HTML5 Working Draft Section 4.10.22.7:
https://w3c.github.io/html/sec-forms.html#multipart-form-data
: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``.
:ret:
A unicode string, stripped of troublesome characters.
r r r )r r r r rB _HTML5_REPLACEMENTS)r&