webzod
account

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

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. Check what the server sends with curl -sI https://example.com/.well-known/security.txt and look at the Content-Type line.
  2. Serve the file as a static file named security.txt with the type text/plain; charset=utf-8. A page built by a framework route or a catch-all rewrite to index.html is the usual cause of text/html.
  3. Save the file itself as utf-8 without special characters in the wrong encoding.
bash
curl -sI https://example.com/.well-known/security.txt | grep -i content-type

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.