Updated
How to Check Website Security Headers (HSTS, CSP)
1. One site with curl
curl -sI https://www.python.org/ | grep -iE '^(strict-transport-security|content-security-policy|x-content-type-options|x-frame-options|referrer-policy|permissions-policy)'On 2 December 2026 this printed strict-transport-security: max-age=63072000; includeSubDomains; preload, x-frame-options: SAMEORIGIN and content-security-policy-report-only: .... Missing lines are missing headers.
2. What each header does
| Header | Protects against | Typical value |
|---|---|---|
| Strict-Transport-Security | Downgrade to HTTP | max-age=31536000; includeSubDomains |
| Content-Security-Policy | Injected scripts (XSS) | default-src 'self'; script-src with nonces |
| X-Content-Type-Options | MIME sniffing | nosniff |
| X-Frame-Options | Clickjacking | DENY or SAMEORIGIN |
| Referrer-Policy | URL leaks to other sites | strict-origin-when-cross-origin |
| Permissions-Policy | Unwanted camera, microphone, location | camera=(), microphone=(), geolocation=() |
3. Common mistakes
- CSP in Report-Only forgotten after testing: it blocks nothing.
- 'unsafe-inline' in script-src without nonces or hashes cancels most of the XSS protection.
- Headers only on the home page: check a deep page and the API host too.
- HEAD vs GET: some servers add headers only on GET.
4. Many sites, graded, as JSON
Plainprobe Domain & Tech Stack Intelligence returns securityHeaders.score (0-100), which of the six headers are present, and one actionable fix per issue, next to DNS, SPF/DMARC, SSL and technologies, at $0.003 per domain. Real output for apify.com on 2 December 2026: score 68, Referrer-Policy and Permissions-Policy missing, fix for the first: Add "Referrer-Policy: strict-origin-when-cross-origin". For a page-level SEO and AI-readiness review, see the website audit.
Limits to keep in mind
- Headers are one layer: they do not replace patching and input validation.
- Scan only sites you own or are allowed to test, and keep the request rate low.
Security headers do not affect speed; to check loading performance, see how to check Core Web Vitals.
FAQ
Which HTTP security headers should a website send?
The usual six are Strict-Transport-Security (HSTS), Content-Security-Policy, X-Content-Type-Options: nosniff, X-Frame-Options (or CSP frame-ancestors), Referrer-Policy and Permissions-Policy.
Does Content-Security-Policy-Report-Only protect the site?
No. The Report-Only variant only reports violations to the browser console or a reporting endpoint; it blocks nothing. python.org sent it in report-only mode on 2 December 2026.
What is a good HSTS value?
max-age of at least one year (31536000) with includeSubDomains; add preload only once every subdomain serves HTTPS. python.org sends max-age=63072000; includeSubDomains; preload.
Can I check headers without loading the whole page?
Yes: curl -sI sends a HEAD request and prints only the response headers. Some servers answer HEAD differently from GET, so confirm with curl -s -D - -o /dev/null for a GET.