--- title: 'CSP: report-to' slug: Web/HTTP/Headers/Content-Security-Policy/report-to tags: - CSP - Content-Security-Policy - HTTP - report-to - コンテンツセキュリティポリシー - セキュリティ - レスポンスヘッダー - 報告 translation_of: Web/HTTP/Headers/Content-Security-Policy/report-to ---
Content-Security-Policy
の Report-To
は HTTP のレスポンスヘッダーフィールドで、ユーザーエージェントにオリジンの報告先のエンドポイントを保存するよう指示します。
Content-Security-Policy: ...; report-to groupname
このディレクティブは単体では効果がありませんが、他のディレクティブとの組み合わせでのみ意味を持ちます。
CSP version | 1 |
---|---|
ディレクティブ種別 | {{Glossary("Reporting directive", "報告ディレクティブ")}} |
このディレクティブは {{HTMLElement("meta")}} 要素では対応していません。 |
Content-Security-Policy: report-to <json-field-value>;
詳しい情報や例は、 {{HTTPHeader("Content-Security-Policy-Report-Only")}} を参照してください。
Report-To: { "group": "csp-endpoint", "max_age": 10886400, "endpoints": [ { "url": "https://example.com/csp-reports" } ] }, { "group": "hpkp-endpoint", "max_age": 10886400, "endpoints": [ { "url": "https://example.com/hpkp-reports" } ] } Content-Security-Policy: ...; report-to csp-endpoint
Report-To: { "group": "endpoint-1", "max_age": 10886400, "endpoints": [ { "url": "https://example.com/reports" }, { "url": "https://backup.com/reports" } ] } Content-Security-Policy: ...; report-to endpoint-1
このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 https://github.com/mdn/browser-compat-data をチェックアウトしてプルリクエストを送信してください。
{{Compat("http.headers.csp.Content-Security-Policy.report-to")}}