Repository URL to install this package:
|
Version:
0.1.9-1 ▾
|
odigos
/
etc
/
odigos-vmagent
/
instrumentations
/
python
/
urllib3
/
http2
/
__pycache__
/
connection.cpython-311.pyc
|
|---|
§
3ç©g|1 ã ó d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Zd dl
ZddlmZ ddl
mZ ddlmZmZ ddlmZ ddlmZ eZ ej d ¦ « Z ej e¦ « Z ej d
¦ « Z ej d¦ « ZddZddZ G d dej! e ¦ « Z" G d de¦ « Z# G d de¦ « Z$dS )é )ÚannotationsNé )Ú
_TYPE_BODY)ÚHTTPHeaderDict)ÚHTTPSConnectionÚ_get_default_user_agent)ÚConnectionError)ÚBaseHTTPResponseÚTs ^[!#$%&'*+\-.^_`|~0-9a-z]+$s* [\0\x00\x0a\x0d\r\n]|^[ \r\n\t]|[ \r\n\t]$ÚnameÚbytesÚreturnÚboolc óP t t | ¦ « ¦ « S )a5
"An implementation that validates fields according to the definitions in Sections
5.1 and 5.5 of [HTTP] only needs an additional check that field names do not
include uppercase characters." (https://httpwg.org/specs/rfc9113.html#n-field-validity)
`http.client._is_legal_header_name` does not validate the field name according to the
HTTP 1.1 spec, so we do that here, in addition to checking for uppercase characters.
This does not allow for the `:` character in the header name, so should not
be used to validate pseudo-headers.
)r ÚRE_IS_LEGAL_HEADER_NAMEÚmatch)r s ú?/tmp/pip-target-fm9nfsjo/lib/python/urllib3/http2/connection.pyÚ_is_legal_header_namer s! õ Õ'×-Ò-¨dÑ3Ô3Ñ4Ô4Ð4ó Úvaluec óP t t | ¦ « ¦ « S )aK
"A field value MUST NOT contain the zero value (ASCII NUL, 0x00), line feed
(ASCII LF, 0x0a), or carriage return (ASCII CR, 0x0d) at any position. A field
value MUST NOT start or end with an ASCII whitespace character (ASCII SP or HTAB,
0x20 or 0x09)." (https://httpwg.org/specs/rfc9113.html#n-field-validity)
)r ÚRE_IS_ILLEGAL_HEADER_VALUEÚsearch)r s r Ú_is_illegal_header_valuer , s! õ Õ*×1Ò1°%Ñ8Ô8Ñ9Ô9Ð9r c ó. e Zd ZdZdZddZddZddZdS )Ú
_LockedObjectaX
A wrapper class that hides a specific object behind a lock.
The goal here is to provide a simple way to protect access to an object
that cannot safely be simultaneously accessed from multiple threads. The
intended use of this class is simple: take hold of it with a context
manager, which returns the protected object.
)ÚlockÚ_objÚobjr c óD t j ¦ « | _ || _ d S ©N)Ú threadingÚRLockr r )Úselfr s r Ú__init__z_LockedObject.__init__D s ÝOÑ%Ô% Ø r r c óB | j ¦ « | j S r! )r Úacquirer ©r$ s r Ú __enter__z_LockedObject.__enter__H s Ø ×ÒÑÔÐØyÐr Úexc_typeútype[BaseException] | NoneÚexc_valúBaseException | NoneÚexc_tbútypes.TracebackType | NoneÚNonec ó8 | j ¦ « d S r! )r Úrelease)r$ r* r, r. s r Ú__exit__z_LockedObject.__exit__L s ð
×ÒÑÔÐÐÐr N)r r )r r )r* r+ r, r- r. r/ r r0 )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú __slots__r% r) r3 © r r r r 6 sa ðð ðIð
ð ð ð ðð ð ð ðð ð ð ð ð r r c ó e Zd Z d*d+ fd
Zd,dZd- fd
Zd.dZd/dZd*d0dZd1dZ d2d3dZ
d4dZ d5d d d d!d6d(Zd- fd)Z
xZS )7ÚHTTP2ConnectionNÚhostÚstrÚportú
int | NoneÚkwargsú
typing.Anyr r0 c óæ | ¦ « | _ d | _ g | _ d|v sd|v rt d¦ « t ¦ « j ||fi |¤ | j t d¦ « d S )NÚproxyÚproxy_configz$Proxies aren't supported with HTTP/2z%Tunneling isn't supported with HTTP/2)Ú_new_h2_connÚ_h2_connÚ
_h2_streamÚ_headersÚNotImplementedErrorÚsuperr% Ú_tunnel_host)r$ r<