,\!UddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ej rdd l mZd Zegd Zd Z ddlZn#e$rddlZYnwxYwed z Zn #e$rYnwxYw ddlZedz Zn #e$rYnwxYwGddeZejZded<ejeefZhdZ d2d3dZ!d4d$Z"d5d)Z#Gd*d+ej$Z%d6d1Z&dS)7) annotationsN) b64encode)Enum)UnrewindableBodyError)to_bytes)Finalz@@@SKIP_HEADER@@@)accept-encodinghost user-agentz gzip,deflatez,brz,zstdceZdZdZdS)_TYPE_FAILEDTELLrN)__name__ __module__ __qualname__token/srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/urllib3/util/request.pyrr's EEErrzFinal[_TYPE_FAILEDTELL] _FAILEDTELL>GETHEADTRACEDELETECONNECTOPTIONS keep_alive bool | Noneaccept_encodingbool | list[str] | str | None user_agent str | None basic_authproxy_basic_auth disable_cachereturndict[str, str]ci}|rMt|trn2t|trd|}nt}||d<|r||d<|rd|d<|r:dt |d|d<|r:dt |d|d <|rd |d <|S) a Shortcuts for generating request headers. :param keep_alive: If ``True``, adds 'connection: keep-alive' header. :param accept_encoding: Can be a boolean, list, or string. ``True`` translates to 'gzip,deflate'. If either the ``brotli`` or ``brotlicffi`` package is installed 'gzip,deflate,br' is used instead. List will get joined by comma. String will be used as provided. :param user_agent: String representing the user-agent you want, such as "python-urllib3/0.6" :param basic_auth: Colon-separated username:password string for 'authorization: basic ...' auth header. :param proxy_basic_auth: Colon-separated username:password string for 'proxy-authorization: basic ...' auth header. :param disable_cache: If ``True``, adds 'cache-control: no-cache' header. Example: .. code-block:: python import urllib3 print(urllib3.util.make_headers(keep_alive=True, user_agent="Batman/1.0")) # {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'} print(urllib3.util.make_headers(accept_encoding=True)) # {'accept-encoding': 'gzip,deflate'} ,r r z keep-alive connectionzBasic zlatin-1 authorizationzproxy-authorizationzno-cachez cache-control) isinstancestrlistjoinACCEPT_ENCODINGrencodedecode)rr r"r$r%r&headerss r make_headersr57s(^!G5 os + + .   . . .!hh77OO-O%4!"+ * - , H HYz00;;<<CCEE G G   N NY/66yAABBIIKK M M  ! .#- Nrbody typing.Anypos_TYPE_BODY_POSITION | Nonec|t||n>t|dd- |}n#t$r t}YnwxYw|S)z If a position is provided, move file to that point. Otherwise, we'll attempt to record a position for future use. Ntell) rewind_bodygetattrr;OSErrorr)r6r8s rset_file_positionr?so D# vt $ $ 0 ))++CC   CCC  Js;AAtyping.IO[typing.AnyStr]body_pos_TYPE_BODY_POSITIONNonec"t|dd}|Et|tr0 ||dS#t$r}t d|d}~wwxYw|t urt dt dt|d)z Attempt to rewind body to a certain position. Primarily used for request redirects and retries. :param body: File-like object that supports seek. :param int pos: Position to seek to in file. seekNzAAn error occurred when rewinding request body for redirect/retry.zRUnable to record file position for rewinding request body during a redirect/retry.z1body_pos must be of type integer, instead it was .)r=r-intr>rr ValueErrortype)r6rA body_seekes rr<r<sfd++IHc!:!:  Ih        'S   [ # 4    QX Q Q Q   s 7 AAAc$eZdZUded<ded<dS)ChunksAndContentLengthztyping.Iterable[bytes] | Nonechunksz int | Nonecontent_lengthN)rrr__annotations__rrrrMrMs*))))rrMtyping.Any | Nonemethodr. blocksizerGc#d}|tvrd}nd}ntttfr&t f}t |d}ntdrd fd }|}d}n_ t}f}|j }nD#t$r7 t}d}n!#t$rtddwxYwYnwxYwt||S) aRTakes the HTTP request method, body, and blocksize and transforms them into an iterable of chunks to pass to socket.sendall() and an optional 'Content-Length' header. A 'Content-Length' of 'None' indicates the length of the body can't be determined so should use 'Transfer-Encoding: chunked' for framing instead. Nrreadr'typing.Iterable[bytes]c3Kttj} }|sdS|r|d}|V5)NTz iso-8859-1)r-io TextIOBaserUr2)r2 datablockrSr6s rchunk_readablez&body_to_chunks..chunk_readablesdbm44F  IIi00  E? ) 0 0 > >I  rzO'body' must be a bytes-like object, file-like object, or iterable. Instead was )rNrO)r'rV) upper_METHODS_NOT_EXPECTING_BODYr-r.bytesr lenhasattr memoryviewnbytes TypeErroriterrM)r6rRrSrNrOr[mvs` ` rbody_to_chunksrfsq$ | <<>>!< < <NN!NN D3, ' '''4.."VAY v  "'  !! 'D!!BWFYNN    d!%   A8<AA   " O O OOs*B)) C*4CC*C$$C*)C*)NNNNNN)rrr r!r"r#r$r#r%r#r&rr'r()r6r7r8r9r'r9)r6r@rArBr'rC)r6rQrRr.rSrGr'rM)' __future__rrXtypingbase64renumr exceptionsrutilr TYPE_CHECKINGtyping_extensionsr SKIP_HEADER frozensetSKIPPABLE_HEADERSr1 brotlicffi_unused_module_brotli ImportErrorbrotli zstandard_unused_module_zstdrrrrPUnionrGrBr]r5r?r< NamedTuplerMrfrrrrzs""""""" ...... ('''''' " IGGGHH /22222 ///....../ uOO   D ++++wOO   D t(8'= ====l3(8#89WVV#59!!#'!% LLLLL^(    <V. CPCPCPCPCPCPsBA A" AA"AA""A*)A*.A88B?B