use get() to access headers; work with None rather that get a KeyError. Added cors * hint