Gate46
  1. All tools
  2. Checks line

HTTP headers

See what a web server sends back before the page itself: the status code, every redirect on the way, caching rules and security headers.

Without http:// or https:// in front, https:// is used.
Method
Follow redirects
Enter a web address to see the headers it answers with.

You will get the status code, each redirect between the address you typed and the page that finally loads, the full header list, and a check of six security headers. Try one of these:

What response headers are

Every time a browser asks for a page, the server answers with a status line and a set of headers before it sends any content. They are instructions for the browser, and you normally never see them.

Headers say what kind of file is coming, how long it may be kept, whether the visitor should go somewhere else, and what the page is allowed to do. When a site behaves oddly, such as an old version that keeps showing, a login that loops or a download that opens as text, the cause is usually visible here. A HEAD request asks for the headers only. GET asks for the whole page, the way a browser does. Most servers answer both the same way, but some refuse HEAD, so switch to GET if the result looks wrong.

Reading the status code

The first digit tells you the family: 2xx worked, 3xx points somewhere else, 4xx means the request was the problem, 5xx means the server was.

CodeNameWhat it means
200OKThe page was served normally
301 / 308Permanent redirectThe address has moved for good. Browsers and search engines remember it
302 / 307Temporary redirectGo elsewhere this time, but keep using the original address
304Not ModifiedThe cached copy is still good, so no content was sent
401 / 403Unauthorized / ForbiddenA login is needed, or the server refuses this visitor
404Not FoundNothing lives at this address. Check the link for typing errors
500Internal Server ErrorThe site's own code failed. The server's error log has the reason
502 / 503 / 504Gateway and availability errorsA proxy or CDN could not get an answer from the server behind it, or the server is overloaded or down for maintenance

Caching headers

  • Cache-Control sets the rules. max-age=3600 allows reuse for an hour, no-cache means check with the server before each reuse, and no-store means never keep a copy.
  • ETag and Last-Modified identify a version of the file. The browser sends them back on the next visit, and the server replies 304 if nothing changed.
  • Age shows how many seconds a copy has sat in a shared cache. If it is present, a CDN or proxy answered, not the origin server.
  • Expires is the older way to set a lifetime. It is ignored when max-age is present.

The redirect chain

Each redirect is a full round trip before anything loads, so short chains are faster. The most important hop is from http:// to https://. Without it, visitors who type the bare name stay on an unencrypted connection that anyone on the same network can read or alter. A good setup gets from http://example.com to the final secure address in one or two hops, with a 301 so browsers remember it. A chain that returns to an address it has already visited is a loop, and browsers give up on it with a "too many redirects" error.

Security headers

The checklist looks for six headers that tell browsers to be stricter with your pages. Strict-Transport-Security closes the gap the first redirect leaves open: after one secure visit, the browser goes straight to HTTPS without asking. Content-Security-Policy is the most capable of the six and takes the most care to set up, because a wrong policy blocks your own scripts. Its frame-ancestors rule replaces the older X-Frame-Options, so either one passes the framing check. A missing header is not a vulnerability by itself. Each one removes a class of attack for the cost of one line of server configuration. Headers can differ from page to page, so check the pages that matter, such as the login form.

Common questions

Why are these headers different from what my browser gets?

The request comes from our server, not from your device. It carries no cookies, so you see the logged-out version of the page. CDNs also answer differently by region, and some sites return 403 or 429 to automated requests while serving browsers normally.

Should I use HEAD or GET?

Start with HEAD. It is lighter because no page content is sent. If you get 405 Method Not Allowed, or headers such as Content-Length are missing, run it again with GET.

Several security headers are missing. Is my site unsafe?

Not necessarily. These headers are extra protection in the browser, not fixes for flaws in the site. Add Strict-Transport-Security, X-Content-Type-Options and Referrer-Policy first, since they rarely break anything. Test Content-Security-Policy in report-only mode before you enforce it.

How can I see headers on my own computer?

Run curl -I https://example.com in a terminal, or open your browser's developer tools, choose the Network tab and select the first request. Both show the response exactly as your own device receives it. To see what your browser says about itself in its requests, use the user agent page.