/usr/lib/python3.9/site-packages/requests/__pycache__
Edit: /usr/lib/python3.9/site-packages/requests/__pycache__/cookies.cpython-39.pyc (18774B)
a
¥/�hþG ã @ sø d Z ddlZddlZddlZddlmZ ddlmZmZm Z m
Z
mZ zddlZW n e
yj ddlZY n0 G dd„ deƒZG dd „ d eƒZd
d„ Zdd
„ Zddd„ZG dd„ deƒZG dd„ dejeƒZdd„ Zdd„ Zdd„ Zd dd„Zdd„ ZdS )!z
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
é Né )Úto_native_string)Ú cookielibÚurlparseÚ
urlunparseÚMorselÚMutableMappingc @ sŽ e Zd ZdZdd„ Zdd„ Zdd„ Zdd „ Zd
d„ Zdd
„ Z dd„ Z
ddd„Zdd„ Zdd„ Z
dd„ Zedd„ ƒZedd„ ƒZedd„ ƒZdS ) ÚMockRequestaò Wraps a `requests.Request` to mimic a `urllib2.Request`.
The code in `cookielib.CookieJar` expects this interface in order to correctly
manage cookie policies, i.e., determine whether a cookie can be set, given the
domains of the request and the cookie.
The original request object is read-only. The client is responsible for collecting
the new headers via `get_new_headers()` and interpreting them appropriately. You
probably want `get_cookie_header`, defined below.
c C s || _ i | _t| j jƒj| _d S ©N)Ú_rÚ_new_headersr ÚurlÚschemeÚtype)ÚselfÚrequest© r ú4/usr/lib/python3.9/site-packages/requests/cookies.pyÚ__init__% s zMockRequest.__init__c C s | j S r
)r ©r r r r Úget_type* s zMockRequest.get_typec C s t | jjƒjS r
)r r r
Únetlocr r r r Úget_host- s zMockRequest.get_hostc C s | ¡ S r
©r r r r r Úget_origin_req_host0 s zMockRequest.get_origin_req_hostc C sT | j j d¡s| j jS t| j jd dd�}t| j jƒ}t|j||j|j |j
|jgƒS )NZHostzutf-8)Úencoding)r ÚheadersÚgetr
r r r r ÚpathÚparamsÚqueryÚfragment)r ÚhostÚparsedr r r Úget_full_url3 s þzMockRequest.get_full_urlc C s dS ©NTr r r r r Úis_unverifiableA s zMockRequest.is_unverifiablec C s || j jv p|| jv S r
)r r r ©r Únamer r r Ú
has_headerD s zMockRequest.has_headerNc C s | j j || j ||¡¡S r
)r r r r )r r( Údefaultr r r Ú
get_headerG s zMockRequest.get_headerc C s t dƒ‚dS )zMcookielib has no legitimate use for this method; add it back if you find one.z=Cookie headers should be added with add_unredirected_header()N)ÚNotImplementedError)r ÚkeyÚvalr r r Ú
add_headerJ s zMockRequest.add_headerc C s || j |<