Web and API security

How to review HTTP security headers

Inspect response headers, understand the role of major browser protections, review CORS and caching, and verify the final production response.

13 min read Reviewed July 19, 2026 Professional reference

Document summary

A practical header-review checklist covering content restrictions, framing, MIME handling, transport, referrers, permissions, CORS, cookies, and caching.

Key takeaways

  • Review the actual production response, not only application configuration.
  • Header values must match the resources and behavior the site really needs.
  • CORS, cookies, caching, and security headers should be evaluated together.
01

Inspect the final response seen by the browser

Headers can be added, removed, or replaced by the application, web server, reverse proxy, content delivery network, or security service. Inspect the final public response for the relevant page and status code.

Check normal pages, redirects, errors, downloads, and API responses because different routes may use different policies.

02

Review core browser security headers

HeaderPurposeReview point
Content-Security-PolicyRestricts scripts, styles, frames, and other resourcesStart with the real resource inventory and reduce unsafe allowances
X-Content-Type-OptionsPrevents MIME type guessingUse nosniff for modern web responses
Referrer-PolicyControls referrer informationChoose a policy that balances privacy and analytics needs
Permissions-PolicyLimits browser featuresDisable camera, microphone, geolocation, and other unused capabilities
Strict-Transport-SecurityKeeps future visits on HTTPSEnable only after HTTPS is reliable for the intended domain scope
frame-ancestors or X-Frame-OptionsControls embeddingUse CSP frame-ancestors for flexible modern policy
03

Treat Content Security Policy as an application policy

A restrictive policy can block required resources, while an overly broad policy provides little protection. Build CSP from an inventory of scripts, styles, images, frames, connections, workers, and form destinations.

Use report-only testing before enforcing a major policy change. Remove inline script and style dependencies where practical.

04

Review CORS as an API access decision

CORS tells browsers which origins may read a response. It is not authentication and does not prevent servers or command-line clients from sending requests.

Avoid reflecting arbitrary origins. Do not combine wildcard origins with credentialed access. Return only the methods and headers the API needs.

Invalid
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Valid
Access-Control-Allow-Origin: https://app.example
Vary: Origin
05

Check cookies and caching with the headers

Session cookies should use Secure on HTTPS, HttpOnly when JavaScript does not need access, and an intentional SameSite value. Sensitive authenticated pages should not be stored in shared caches.

Public static assets can use long-lived caching when filenames are versioned. Private API responses need a policy appropriate to their data.

06

Verify across environments and routes

  1. 1

    Inspect production HTTPS responses.

  2. 2

    Check redirects and error pages.

  3. 3

    Test CSP in the browser console.

  4. 4

    Verify CORS with allowed and disallowed origins.

  5. 5

    Review cookie flags after login.

  6. 6

    Re-run the check after proxy, CDN, or deployment changes.

Jump to tool

Open the HTTP Header Analyzer and review a response header block

Open tool