Missing Strict-Transport-Security, a Content-Security-Policy that was dropped in the last deploy, an http:// URL that doesn't redirect to https://, a certificate about to expire: these show up in security questionnaires and pentest reports. Checking them takes a few fields from one request, collected from a real browser visit.
Headers, redirects and certificate in one request
curl -X POST "https://shotkit.net/api/take" \
-H "X-Access-Key: YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"http://example.com","response_type":"json","format":"png","metadata_http_response_status_code":true,"metadata_http_response_headers":true,"metadata_redirects":true,"metadata_tls":true}' \
--fail-with-body -o shot.jsonStarting from http:// shows whether the site upgrades to https://: metadata.redirects lists every hop. http_response.headers are the final page's headers, with lowercase names. metadata.tls is the certificate Chrome accepted for it.
Grade the result
A short script turns the response into a pass/fail list you can run in CI or on a schedule:
const res = await fetch("https://shotkit.net/api/take", {
method: "POST",
headers: { "X-Access-Key": process.env.SHOTKIT_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
url: "http://example.com", response_type: "json",
metadata_http_response_headers: true, metadata_redirects: true, metadata_tls: true,
}),
}).then((r) => r.json());
const h = res.http_response.headers;
const final = res.metadata.redirects.at(-1).url;
const daysLeft = res.metadata.tls ? (Date.parse(res.metadata.tls.valid_to) - Date.now()) / 864e5 : 0;
const checks = {
"redirects to https": final.startsWith("https://"),
"HSTS": /max-age=\d{7,}/.test(h["strict-transport-security"] ?? ""),
"CSP": Boolean(h["content-security-policy"]),
"clickjacking protection": /deny|sameorigin/i.test(h["x-frame-options"] ?? "") || /frame-ancestors/.test(h["content-security-policy"] ?? ""),
"nosniff": h["x-content-type-options"] === "nosniff",
"referrer policy": Boolean(h["referrer-policy"]),
"certificate valid 30+ days": daysLeft >= 30,
"TLS 1.2+": /TLS 1\.[23]/.test(res.metadata.tls?.protocol ?? ""),
};
for (const [name, ok] of Object.entries(checks)) console.log(ok ? "✓" : "✗", name);max-age=\d{7,} asks for at least about four months (10000000 seconds); raise it to match your policy.
Catch regressions after deploys
Headers are easy to lose: a new CDN rule, a framework upgrade or a proxy in front of a preview environment can drop them silently. Run the script after each deploy against your main pages, and fail the build when a check flips. The screenshot in the same response shows what was actually served, which helps when a CDN error page is the thing missing the headers.
Frequently asked questions
Why use a browser instead of curl?
curl sees the first response only. A browser follows redirects the way users do, accepts or rejects the certificate the way Chrome does, and gives you a screenshot of the page that came back. For a single header check either works; for "what do users actually get", the browser is the honest answer.
Can I check the headers on every redirect hop?
metadata.redirects gives each hop's URL and status. Headers are returned for the final page only; request a hop's URL directly to see its headers.
Does this replace a vulnerability scanner?
No. It checks what a site declares (headers, redirects, certificate), not whether it's exploitable. Use it to keep a baseline in place between pentests.