New implementation for setDefaultHeaders, dealing with the multiple 'Access-Control-Allow-Origin' problem.