
    h'                        S SK r S SKJrJrJrJrJrJrJrJ	r	  SSK
JrJr  SSKJrJrJr  \(       a  SSKJr   S SKJr  \ R,                  " S5      r\ R,                  " \R0                  " S	5      5      r\ R,                  " \R0                  " S	5      5      r " S
 S\\\\4      5      r\	\\\\4      \\\\4      \\\\4      \\\\4      4   r\S\S\S   S\4S j5       r\S\S\S   S\4S j5       r\ SS\	\\4   S\ S\4S jj5       r SS\	\\4   S\ S\4S jjrS\S\S\\   4S jr!S\S\S\\   S\4S jr"SSS\ 4S jr#g! \ a
    S SKJr   GNf = f)    N)AnyStrcastListoverloadSequenceTupleTYPE_CHECKINGUnion   )
field_namefield_value)bytesifyLocalProtocolErrorvalidate)Request)Literals   [0-9]+asciic                       \ rS rSrSrSrS\\\\\4      SS4S jr	S\
4S jrS	\S\
4S
 jrS\4S jrS\4S jrS\S\\\4   4S jrS\\\\4      4S jrSrg)HeadersK   a  
A list-like interface that allows iterating over headers as byte-pairs
of (lowercased-name, value).

Internally we actually store the representation as three-tuples,
including both the raw original casing, in order to preserve casing
over-the-wire, and the lowercased name, for case-insensitive comparisions.

r = Request(
    method="GET",
    target="/",
    headers=[("Host", "example.org"), ("Connection", "keep-alive")],
    http_version="1.1",
)
assert r.headers == [
    (b"host", b"example.org"),
    (b"connection", b"keep-alive")
]
assert r.headers.raw_items() == [
    (b"Host", b"example.org"),
    (b"Connection", b"keep-alive")
]
_full_items
full_itemsreturnNc                     Xl         g Nr   )selfr   s     >/var/www/html/env/lib/python3.13/site-packages/h11/_headers.py__init__Headers.__init__f   s    %    c                 ,    [        U R                  5      $ r   )boolr   r   s    r   __bool__Headers.__bool__i   s    D$$%%r!   otherc                 0    [        U 5      [        U5      :H  $ r   )list)r   r'   s     r   __eq__Headers.__eq__l   s    DzT%[((r!   c                 ,    [        U R                  5      $ r   )lenr   r$   s    r   __len__Headers.__len__o   s    4##$$r!   c                 0    S[        [        U 5      5      -  $ )Nz<Headers(%s)>)reprr)   r$   s    r   __repr__Headers.__repr__r   s    d4j!111r!   idxc                 ,    U R                   U   u  p#nX44$ r   r   )r   r4   _namevalues        r   __getitem__Headers.__getitem__u   s    ))#.}r!   c                 Z    U R                    VVVs/ s H	  u  po1U4PM     snnn$ s  snnnf r   r   )r   raw_namer6   r8   s       r   	raw_itemsHeaders.raw_itemsy   s*    <@<L<LM<L&8h55!<LMMMs   &r   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r   bytesr   r#   r%   objectr*   intr.   strr2   r9   r=   __static_attributes__ r!   r   r   r   K   s    0 I&4eUE.A(B#C & &&$ &)F )t )% %2# 2s uUE\': N4eUl 34 Nr!   r   headers_parsedTr   c                     g r   rJ   rK   rL   s     r   normalize_and_validaterO          r!   Fc                     g r   rJ   rN   s     r   rO   rO      rP   r!   c                     g r   rJ   rN   s     r   rO   rO      s     r!   c                 H   / nS nSnU  GH  u  pVU(       d:  [        U5      n[        U5      n[        [        USU5        [        [        USU5        [	        U[
        5      (       d   e[	        U[
        5      (       d   eUnUR                  5       nUS:X  a  UR                  S5       Vs1 s H  oR                  5       iM     n	n[        U	5      S:w  a  [        S5      eU	R                  5       n[        [        US5        Uc  UnUR                  XuU45        GM  X6:w  a  [        S5      eGM$  US	:X  aI  U(       a
  [        S
SS9eUR                  5       nUS:w  a
  [        SSS9eSnUR                  XuU45        GMs  UR                  XuU45        GM     [        U5      $ s  snf )NFzIllegal header name {!r}zIllegal header value {!r}s   content-length   ,r   z"conflicting Content-Length headerszbad Content-Lengths   transfer-encodingz"multiple Transfer-Encoding headersi  )error_status_hints   chunkedz,Only Transfer-Encoding: chunked is supportedT)r   r   _field_name_re_field_value_re
isinstancerE   lowersplitstripr-   r   pop_content_length_reappendr   )
rK   rL   new_headersseen_content_lengthsaw_transfer_encodingr7   r8   r<   lengthlengthss
             r   rO   rO      s    K! D>DUOE^T+EtL_e-H%P$&&&&%''''zz|$$49KK4EF4E&||~4EGF7|q ()MNNKKME'0DE"*&+#""HE#:;$-()MNN .))
 %(8C 
 KKME
"(B&)  %)!6767[ \ ;? Gs   )Fr7   c                     / nU R                    H_  u  p4nXA:X  d  M  UR                  5       nUR                  S5       H-  nUR                  5       nU(       d  M  UR	                  U5        M/     Ma     U$ )NrT   )r   rY   rZ   r[   r^   )rK   r7   outr6   
found_namefound_raw_valuefound_split_values          r   get_comma_headerri      ss    H C*1*=*=&-335O%4%:%:4%@!$5$;$;$=!$$JJ01 &A +> Jr!   
new_valuesc                     / nU R                    H  u  pEnXQ:w  d  M  UR                  XF45        M!     U H$  nUR                  UR                  5       U45        M&     [        U5      $ r   )r   r^   titlerO   )rK   r7   rj   r_   found_raw_namerf   rg   	new_values           r   set_comma_headerro      sf     .0K7>7J7J3O@A 8K  	DJJL)45  !+..r!   requestr   c                 Z    U R                   S:  a  g[        U R                  S5      nSU;   $ )Ns   1.1Fs   expects   100-continue)http_versionri   rK   )rp   expects     r   has_expect_100_continuert     s0     f$gooy9Ff$$r!   )F)$retypingr   r   r   r   r   r   r	   r
   _abnfr   r   _utilr   r   r   _eventsr   r   ImportErrortyping_extensionscompiler]   encoderV   rW   rE   r   rH   HeaderTypesrO   r#   ri   ro   rt   rJ   r!   r   <module>r      s   	 V V V * 9 9 *v ZZ
+ J--g67**[//89/NhuUE\*+ /Nd ue|	ucz	sEz	sCx 
G gdm   
 
K '%. W  
 
:?7K'(37 
 ;@4 7K'(4 374 4 n,g ,U ,tE{ ,^/g /U /U /PW /&%Y %4 %G  *))*s   E
 
EE