3
ò\ð];  ã            	   @   s"   d ddddddddœZ d	d
„ ZdS )ztext/cssz	image/gifz	text/htmlz
image/jpegzapplication/javascriptzapplication/jsonz	image/pngz
text/plain)ÚcssZgifÚhtmlZjpgZjsÚjsonZpngÚtxtc             C   sP  | |kr||  }npd}d}xf| dkr€| j ddƒ\} }d| | }| |krX||  | }P q| d |kr|| d  |dd…  }P qW |�rLt|tƒršd|i}|d jdƒ�r d|k�rt|d tƒrØ|d  |d 7  < n6|d  |d d 7  < d|d k�r |d d |d< n|d  d7  < d|k�rL|d j dƒd
 }tj|d	ƒ|d< |S )a}  Return the local filename and content type for the requested static
    file URL.

    :param path: the path portion of the requested URL.
    :param static_files: a static file configuration dictionary.

    This function returns a dictionary with two keys, "filename" and
    "content_type". If the requested URL does not match any static file, the
    return value is None.
    NÚ ú/é   ÚfilenameÚcontent_typez
index.htmlÚ.zapplication/octet-streaméÿÿÿÿ)ÚrsplitÚ
isinstanceÚstrÚendswithÚcontent_typesÚget)ÚpathZstatic_filesÚfÚrestÚlastÚext© r   ú@/tmp/pip-build-mqc4i71p/python-engineio/engineio/static_files.pyÚget_static_file   s:    




r   N)r   r   r   r   r   r   Ú<module>   s   