Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/urllib3/__pycache__/fields.cpython-311.pyc
]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 <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``.
:ret:
An RFC-2231-formatted unicode string.
utf-8c 3 K | ]}|v V d S N ).0chvalues r <genexpr>z.format_header_param_rfc2231.<locals>.<genexpr>+ 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
<dictcomp>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.<locals>.replacerS s 'A77r |c 6 g | ]}t j | S r )reescape)r needles r
<listcomp>z%_replace_multiple.<locals>.<listcomp>W s"