def clean_headers_server(header):
    """
    Only allows through headers which are safe to pass to the client
    """
    valid = ['content-length', 'content-type', 'x-roll-ntime', 
             'x-reject-reason', 'noncerange']
    for name, value in header.items():
        if name.lower() not in valid:
            del header[name]
        else:
            del header[name]
            header[name.lower()] = value
    return header
dataset/ETHPy150Open c00w/bitHopper/bitHopper/Mining_Site/headers.py/clean_headers_server/original