CORS issue with some requests

It looks like the first request has a 502 status code. That issue needs to be resolved, rather than trying to get CORS headers on error pages!