Better handling of CORS headers for CORS proxy errors