Wat is Reporting API Header Generator?
The Reporting API is a browser API that collects reports about various issues — CSP violations, Network Error Logging events, deprecation warnings, browser interventions, and crash reports — and sends them to a configurable endpoint. It uses HTTP headers (Report-To or Reporting-Endpoints) to tell the browser where to send reports. The Reporting-Endpoints header is the newer standard, replacing the legacy Report-To header. Browsers batch reports and send them periodically to minimize network overhead.
Snel antwoord
Generate Report-To and Reporting-Endpoints HTTP headers for Nginx and Apache. Choose between legacy Report-To and newer Reporting-Endpoints syntax. Optionally configure CSP report-uri/report-to directives and Network Error Logging (NEL) headers. The Reporting API (Chrome 69+, Safari 16.4+, Edge 79+) collects CSP violations, NEL events, deprecation warnings, browser interventions, and crash reports at a central endpoint.
Beperkingen
- Reporting-Endpoints header support varies by browser. Chrome supports it from version 69+, Safari from 16.4+, and Edge from 79+. Firefox support for Reporting-Endpoints is limited. The legacy Report-To header is still needed for broader browser compatibility.
- Reports are not guaranteed to be delivered. Browsers batch reports and send them on their own schedule. If the user closes the tab before the batch is sent, reports may be lost. Do not rely on the Reporting API for critical monitoring — use it as a supplemental data source alongside server-side logging.
- The reporting endpoint must be accessible via HTTPS. Browsers refuse to send reports to HTTP endpoints for sites served over HTTPS. GitHub Pages sites using a custom reporting collector must ensure the collector has a valid TLS certificate.
Zo gebruik je deze tool
- Choose the header version: legacy Report-To for broader compatibility or the newer Reporting-Endpoints standard header. Reporting-Endpoints is simpler but has newer browser support.
- Select your server type (Nginx or Apache) and copy the generated header configuration into your server config, virtual host block, or .htaccess file.
- Optionally enable CSP Reporting by selecting a CSP directive type (report-uri, report-to, or both). The generated snippet includes the appropriate CSP reporting directives.
- Optionally configure Network Error Logging (NEL) with your reporting endpoint URL, cache duration, and success/failure sampling rates.
Waarvoor je het kunt gebruiken
- Collect CSP violation reports at a central endpoint to monitor and fine-tune your Content Security Policy without blocking legitimate content.
- Monitor Network Error Logging reports to detect and diagnose network failures, DNS issues, TLS errors, and connectivity problems experienced by real users.
- Receive deprecation warnings and browser intervention reports to identify features on your site that need updating before browsers remove support.