def get_content_type_by_name()

in source/tools/host_files.py [0:0]


def get_content_type_by_name(file_name):
    ext = os.path.splitext(file_name)[1]
    if ext == '.html':
        return 'text/html'
    elif ext == '.png':
        return 'image/png'
    elif ext == '.txt':
        return 'text/plain'
    elif ext == '.template':
        return 'application/json'
    elif ext == '.ico':
        return 'image/x-icon'
    elif ext == '.js' or ext == '.map':
        return 'application/javascript'
    elif ext == '.json':
        return 'application/json'
    elif ext == '.yaml':
        return 'text/yaml'
    elif ext == '.jar':
        return 'application/java-archive'
    elif ext == '.zip':
        return 'application/zip'
    else:
        return 'binary/octet-stream'