Security headers › Cross-Origin-Resource-Policy
How to add the Cross-Origin-Resource-Policy header in Vercel
CORP lets you say which origins may load your resources, such as images and scripts.
Vercel configuration (vercel.json)
{
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "Cross-Origin-Resource-Policy",
"value": "same-origin"
}
]
}
]
}Add to vercel.json at the project root and redeploy. Next.js projects on Vercel can set headers in next.config instead.
Before you deploy
Use same-site or cross-origin for assets that other sites or your CDN subdomains legitimately load.
Verify it works
curl -sI https://your-site.com | grep -i cross-origin-resource-policyOr run a free Korrali Web scan to check this and every other security header at once.