whitelist = headers.get('X_NETWORK_WHITELIST', '')
whitelist = whitelist.split(',')

To simplify