+
    i                    V   ^ RI Ht ^ RIt^ RIt^ RIt^RIHt ^RIHt RR.t	]
! ]P                  P                  RR4      4      t]
! ]P                  P                  R	R
4      4      tR R lt]P                   ! R4      t]P                   ! R4      tR R ltR R ltR R ltR R ltR# )    )annotationsN)Headers)SecurityErrorread_requestread_responseWEBSOCKETS_MAX_NUM_HEADERS128WEBSOCKETS_MAX_LINE_LENGTH8192c                    V ^8  d   QhRRRR/# )   valuebytesreturnstr )formats   "]/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/websockets/legacy/http.py__annotate__r      s     3 3U 3s 3    c                &    V P                  RR7      # )z?
Decode a bytestring for interpolating into an error message.

backslashreplace)errors)decode)r   s   &r   dr      s    
 <<1<22r   s   [-!#$%&\'*+.^_`|~0-9a-zA-Z]+s   [\x09\x20-\x7e\x80-\xff]*c                    V ^8  d   QhRRRR/# )r   streamasyncio.StreamReaderr   ztuple[str, Headers]r   )r   s   "r   r   r   -   s     . .3 .8K .r   c                  "    \        V 4      G Rj  xL
 p TP                  R^4      w  r4pTR8w  d   \        R\	        T4       24      hTR8w  d   \        R\	        T4       24      hTP                  R	R
4      p\        T 4      G Rj  xL
 pYg3#  L~  \         d   p\        R4      ThRp?ii ; i  \         d    \        R\	        T4       24      Rhi ; i LO5i)a  
Read an HTTP/1.1 GET request and return ``(path, headers)``.

``path`` isn't URL-decoded or validated in any way.

``path`` and ``headers`` are expected to contain only ASCII characters.
Other characters are represented with surrogate escapes.

:func:`read_request` doesn't attempt to read the request body because
WebSocket handshake requests don't have one. If the request contains a
body, it may be read from ``stream`` after this coroutine returns.

Args:
    stream: Input to read the request from.

Raises:
    EOFError: If the connection is closed without a full HTTP request.
    SecurityError: If the request exceeds a security limit.
    ValueError: If the request isn't well formatted.

Nz1connection closed while reading HTTP request line    zinvalid HTTP request line: s   GETzunsupported HTTP method:    HTTP/1.1unsupported HTTP version: asciisurrogateescape)	read_lineEOFErrorsplit
ValueErrorr   r   read_headers)r   request_lineexcmethodraw_pathversionpathheaderss   &       r   r   r   -   s     8U&v..T$0$6$6tQ$?!' 4QvYK@AA+5aj\BCC??7$56D ((G=# / UJKQTTU
  T6q6GHItST )sU   CB BB B2 AC	C
CB B/B**B//C2$CCc                    V ^8  d   QhRRRR/# )r   r   r   r   ztuple[int, str, Headers]r   )r   s   "r   r   r   ^   s     1( 1( 4 1(9Q 1(r   c                  "    \        V 4      G Rj  xL
 p TP                  R^4      w  r4pTR8w  d   \        R\	        T4       24      h \        T4      p^dTu;8:  d   R8  g   M \        R	\	        T4       24      h\        P                  T4      '       g   \        R
\	        T4       24      hTP                  4       p\        T 4      G Rj  xL
 pYgT3#  L  \         d   p\        R4      ThRp?ii ; i  \         d    \        R\	        T4       24      Rhi ; i  \         d    \        R\	        T4       24      Rhi ; i Lw5i)a  
Read an HTTP/1.1 response and return ``(status_code, reason, headers)``.

``reason`` and ``headers`` are expected to contain only ASCII characters.
Other characters are represented with surrogate escapes.

:func:`read_request` doesn't attempt to read the response body because
WebSocket handshake responses don't have one. If the response contains a
body, it may be read from ``stream`` after this coroutine returns.

Args:
    stream: Input to read the response from.

Raises:
    EOFError: If the connection is closed without a full HTTP response.
    SecurityError: If the response exceeds a security limit.
    ValueError: If the response isn't well formatted.

Nz0connection closed while reading HTTP status liner    zinvalid HTTP status line: r!   r"   zinvalid HTTP status code: i  zunsupported HTTP status code: zinvalid HTTP reason phrase: )
r%   r&   r'   r(   r   int	_value_re	fullmatchr   r)   )	r   status_liner+   r.   raw_status_code
raw_reasonstatus_codereasonr0   s	   &        r   r   r   ^   sa    2T%f--R/:/@/@q/I,* +5aj\BCCV/* +$$9!O:L9MNOOz**7*GHH F ((G''/ . TIJPSST
  R5an5EFGTQR  V5a6H5IJKQUUV )ss   E	C CC C9 E	D  AE	5E	EE	C C6%C11C66E	9$DE	 $EE	c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r      s     % %3 % %r   c                  "   \        4       p\        \        ^,           4       F  p \        V 4      G Rj  xL
 pTR8X  d    T#  TP                  R^4      w  rV\        P                  T4      '       g   \        R\        T4       24      hTP                  R4      p\        P                  T4      '       g   \        R\        T4       24      hTP                  R	4      pTP                  R	R
4      pYT&   K  	  \        R4      h L  \         d   p\	        R4      ThRp?ii ; i  \         d    \        R\        T4       24      Rhi ; i5i)zc
Read HTTP headers from ``stream``.

Non-ASCII characters are represented with surrogate escapes.

Nz,connection closed while reading HTTP headersr      :zinvalid HTTP header line: zinvalid HTTP header name: s    	zinvalid HTTP header value: r#   r$   ztoo many HTTP headers)r   rangeMAX_NUM_HEADERSr%   r&   r'   r(   r   	_token_rer5   stripr4   r   r   )	r   r0   _liner+   raw_name	raw_valuenamer   s	   &        r   r)   r)      sG     iG?Q&'	T"6**D 3;& N#	O"&**T1"5H ""8,,9!H+GHHOOF+	""9--:1Y<.IJJw'  *;<) (. 344+ + 	TIJPSS	T  	O9!D'CD$N	Os]   $EDDD
ED%E4AE7AEDD"DD""E%$E		Ec                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   r      s      0 U r   c                   "   V P                  4       G Rj  xL
 p\        V4      \        8  d   \        R4      hVP	                  R4      '       g   \        R4      hVRR #  LJ5i)zO
Read a single line from ``stream``.

CRLF is stripped from the return value.

Nzline too longs   
zline without CRLF)readlinelenMAX_LINE_LENGTHr   endswithr&   )r   rC   s   & r   r%   r%      sY      ""D
4y?"O,,==!!*++9 #s   A#A!9A#A#)
__future__r   asyncioosredatastructuresr   
exceptionsr   __all__r3   environgetr?   rL   r   compiler@   r4   r   r   r)   r%   r   r   r   <module>rX      s    "  	 	 $ & ?
+bjjnn%A5IJbjjnn%A6JK3 JJ78	 JJ45	.b1(h%Pr   