CORS Diplomat — Web Fundamentals

Set CORS headers so legit cross-origin requests get through and the rest are blocked: 12 levels of CORS, preflight and security headers.