If headers is a dict, you don't need to use .keys(), it's the default behavior 'in' for a dict to only check the keys.