
]'v_E  ã               @   sX   d  d l  m Z d  d l m Z d  d l m Z d Z d d d d d d d d „ Z d S)é    )Úabsolute_import)Ú	b64encode)Úbzgzip,deflateNc             C   sÕ   i  } | rO t  | t ƒ r n' t  | t ƒ r? d j | ƒ } n t } | | d <| r_ | | d <|  ro d | d <| r˜ d t t | ƒ ƒ j d ƒ | d <| rÁ d t t | ƒ ƒ j d ƒ | d	 <| rÑ d
 | d <| S)a  
    Shortcuts for generating request headers.

    :param keep_alive:
        If ``True``, adds 'connection: keep-alive' header.

    :param accept_encoding:
        Can be a boolean, list, or string.
        ``True`` translates to 'gzip,deflate'.
        List will get joined by comma.
        String will be used as provided.

    :param user_agent:
        String representing the user-agent you want, such as
        "python-urllib3/0.6"

    :param basic_auth:
        Colon-separated username:password string for 'authorization: basic ...'
        auth header.

    :param proxy_basic_auth:
        Colon-separated username:password string for 'proxy-authorization: basic ...'
        auth header.

    :param disable_cache:
        If ``True``, adds 'cache-control: no-cache' header.

    Example::

        >>> make_headers(keep_alive=True, user_agent="Batman/1.0")
        {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
        >>> make_headers(accept_encoding=True)
        {'accept-encoding': 'gzip,deflate'}
    ú,zaccept-encodingz
user-agentz
keep-aliveZ
connectionzBasic zutf-8Zauthorizationzproxy-authorizationzno-cachezcache-control)Ú
isinstanceÚstrÚlistÚjoinÚACCEPT_ENCODINGr   r   Údecode)Z
keep_aliveZaccept_encodingZ
user_agentZ
basic_authZproxy_basic_authZdisable_cacheZheaders© r   ú6/usr/lib/python3/dist-packages/urllib3/util/request.pyÚmake_headers	   s*    $


  
r   )Z
__future__r   Úbase64r   Zsixr   r
   r   r   r   r   r   Ú<module>   s
   	