Refactor CORS header asserts in functional tests