R`iH d Z ddlZddlZddlZddlmZ ddlmZmZm Z m Z mZ ddlZ G d d Z G d d Zd Zd ZddZ G d de Z G d de j, e Zd Zd Zd ZddZd Zy# e $ r ddlZY [w xY w)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)MorselMutableMapping cookieliburlparse urlunparsec e Zd ZdZd Zd Zd Zd Zd Zd Z d Z dd Zd Zd Z d Zed Zed Zed Zy )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 | || _ i | _ t | j j j | _ y N)_r_new_headersr urlschemetype)selfrequests /builddir/build/BUILDROOT/alt-python312-pip-23.3.1-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/requests/cookies.py__init__zMockRequest.__init__# s+ TWW[[)00 c | j S r )r r s r get_typezMockRequest.get_type( s yyr c T t | j j j S r )r r r netlocr s r get_hostzMockRequest.get_host+ s $+++r c " | j S r r r s r get_origin_req_hostzMockRequest.get_origin_req_host. s }}r c | j j j d s| j j S t | j j d d }t | j j }t |j ||j |j |j |j g S )NHostzutf-8)encoding)r headersgetr r r r r pathparamsqueryfragment)r hostparseds r get_full_urlzMockRequest.get_full_url1 s ww""6*77;; 7'J$''++& r c yNT r s r is_unverifiablezMockRequest.is_unverifiableE s r c R || j j v xs || j v S r )r r$ r r names r has_headerzMockRequest.has_headerH s% tww&C$$2C2C*CCr Nc | j j j || j j || S r )r r$ r% r )r r3 defaults r get_headerzMockRequest.get_headerK s0 ww""4):):)>)>tW)MNNr c 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 keyvals r add_headerzMockRequest.add_headerN s !K r c " || j |<