webzod
account

Serve security.txt as text/plain with utf-8 on Vercel

hygiene.security_txt.wrong_content_type · effort: minutes

Why it matters

RFC 9116 requires the file to be sent as text/plain in utf-8. Tools may reject it if the server labels it as html, binary or another charset.

The fix

  1. Serve the file as a static file at public/.well-known/security.txt so Vercel sets the type from the extension. A route, rewrite or middleware that answers that path with html is the usual cause.
  2. If you need to force the type, add a header rule to vercel.json, redeploy and check the response again.
vercel.json
{
  "headers": [
    {
      "source": "/.well-known/security.txt",
      "headers": [
        { "key": "Content-Type", "value": "text/plain; charset=utf-8" }
      ]
    }
  ]
}

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.