def get_filename(path, server_name):
    """Get the filename from a .header file"""
    with open(path, 'r') as f:
        data = f.read()
    ret = data.split(server_name)[1].split()[0].split('?')[0]
    if ret.endswith('/'):
        raise Exception('directory entry')
    return ret.strip('/')