� ��^i�G � �$ � d Z ddlZddlZddlZddlmZ ddlmZmZm Z m Z mZ ddlZn# e $ r ddlZY nw xY w G d� de� � Z G d� d e� � Zd � Zd� Zdd�Z G d � de� � Z G d� dej e� � Zd� Zd� Zd� Zdd�Zd� 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 � � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z dd �Zd� Zd� Z d � Zed� � � Zed� � � Zed� � � Zd S )�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 �h � || _ i | _ t | j j � � j | _ d S �N)�_r�_new_headersr �url�scheme�type)�self�requests ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/requests/cookies.py�__init__zMockRequest.__init__% s+ � ��������T�W�[�)�)�0�� � � � c � � | j S r )r �r s r �get_typezMockRequest.get_type* s � ��y�r c �> � t | j j � � j S r )r r r �netlocr s r �get_hostzMockRequest.get_host- s � �����$�$�+�+r c �* � | � � � S r �r r s r �get_origin_req_hostzMockRequest.get_origin_req_host0 s � ��}�}���r c �( � | j j � d� � s| j j S t | j j d d�� � }t | j j � � }t |j ||j |j |j |j g� � S )N�Hostzutf-8)�encoding)r �headers�getr r r r r �path�params�query�fragment)r �host�parseds r �get_full_urlzMockRequest.get_full_url3 s� � � �w��"�"�6�*�*� ��7�;������� 7�'�J�J�J���$�'�+�&�&����M�4���f�m�V�\��O� � � � r c � � dS �NT� r s r �is_unverifiablezMockRequest.is_unverifiableA s � ��tr c �0 � || j j v p|| j v S r )r r$ r �r �names r � has_headerzMockRequest.has_headerD s � ��t�w��&�C�$�$�2C�*C�Cr Nc �t � | j j � || j � ||� � � � S r )r r$ r% r )r r3 �defaults r � get_headerzMockRequest.get_headerG s/ � ��w��"�"�4��):�)>�)>�t�W�)M�)M�N�N�Nr 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 �key�vals r � add_headerzMockRequest.add_headerJ s � �!�"a�b�b�br c � � || j |<