def get_content_type (headers):
    """
    Get the MIME type from the Content-Type header value, or
    'application/octet-stream' if not found.

    @return: MIME type
    @rtype: string
    """
    ptype = headers.get('Content-Type', 'application/octet-stream')
    if ";" in ptype:
        # split off not needed extension info
        ptype = ptype.split(';')[0]
    return ptype.strip().lower()
def get_content_type ( headers ) : ptype = headers . get ( 'Content-Type' , 'application/octet-stream' ) if ";" in ptype : ptype = ptype . split ( ';' ) [ 0 ] return ptype . strip ( ) . lower ( )
Get the MIME type from the Content-Type header value, or
    'application/octet-stream' if not found.

    @return: MIME type
    @rtype: string