o
    ËÇîgt  ã                   @   s$   d Z ddlmZ G dd„ deƒZdS )zš
requests_toolbelt.adapters.host_header_ssl
==========================================

This file contains an implementation of the HostHeaderSSLAdapter.
é    )ÚHTTPAdapterc                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚHostHeaderSSLAdaptera‘  
    A HTTPS Adapter for Python Requests that sets the hostname for certificate
    verification based on the Host header.

    This allows requesting the IP address directly via HTTPS without getting
    a "hostname doesn't match" exception.

    Example usage:

        >>> s.mount('https://', HostHeaderSSLAdapter())
        >>> s.get("https://93.184.216.34", headers={"Host": "example.org"})

    c                    sl   d }|j D ]}| ¡ dkr|j | } nq| jj}|r ||d< n
d|v r*| dd ¡ tt| ƒj|fi |¤ŽS )NÚhostÚassert_hostname)ÚheadersÚlowerÚpoolmanagerÚconnection_pool_kwÚpopÚsuperr   Úsend)ÚselfÚrequestÚkwargsÚhost_headerÚheaderÚconnection_pool_kwargs©Ú	__class__© úc/home/ubuntu/webapp/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/host_header_ssl.pyr      s   

þ
zHostHeaderSSLAdapter.send)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   r   r   r      s    r   N)r   Úrequests.adaptersr   r   r   r   r   r   Ú<module>   s   