Fix header issue with new Werkzeug

Updated for the new master and to pass the tests.