/usr/lib/python3/dist-packages/requests/__pycache__
Edit: /usr/lib/python3/dist-packages/requests/__pycache__/cookies.cpython-310.pyc (18639B)
o
Ba_G @ s d Z ddlZddlZddlZddlmZ ddlmZmZm Z m
Z
mZ zddlZW n
e
y5 ddlZY nw G dd deZG dd d eZd
d Zdd
ZdddZG dd deZG dd dejeZdd Zdd Zdd Zd ddZdd 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) cookieliburlparse
urlunparseMorselMutableMappingc @ s e Zd ZdZdd Zdd Zdd Zdd Zd
d Zdd
Z dd Z
dddZdd 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 jj| _d S N)_r_new_headersr urlschemetype)selfrequest r 2/usr/lib/python3/dist-packages/requests/cookies.py__init__% s zMockRequest.__init__c C | j S r
)r r r r r get_type* zMockRequest.get_typec C s t | jjjS r
)r r r
netlocr r r r get_host- zMockRequest.get_hostc C | S r
r r r r r get_origin_req_host0 s zMockRequest.get_origin_req_hostc C sT | j jds| j jS t| j jd dd}t| j j}t|j||j|j |j
|jgS )NHostzutf-8)encoding)r headersgetr
r r r r pathparamsqueryfragment)r hostparsedr 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)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())NotImplementedError)r keyvalr r r
add_headerJ zMockRequest.add_headerc C s || j |<