{"result":{"depiction_url":null,"edges":{"subject":{"objects":[{"created":"2026-09-09T13:47:32Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:47:32Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-09-09T13:47:32Z","object_id":{"id":2627,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_notification","title":"Notification","uri":"https:\/\/zotonic.com\/id\/2627"},"seq":3},{"created":"2026-09-09T13:47:32Z","object_id":{"id":2676,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_http","title":"HTTP","uri":"https:\/\/zotonic.com\/id\/2676"},"seq":4},{"created":"2026-09-09T13:47:32Z","object_id":{"id":2685,"is_a":["categorization","keyword","keyword_quality"],"name":"zotonic_topic_security","title":"Security","uri":"https:\/\/zotonic.com\/id\/2685"},"seq":5}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2517,"is_a":["text","documentation","reference","notification"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2517"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_notification_content_security_report","page_url":{"en":"https:\/\/zotonic.com\/docs\/2517\/observe_content_security_report-2","x-default":"https:\/\/zotonic.com\/docs\/2517\/observe_content_security_report-2"},"preview_url":null,"resource":{"version":109,"pivot_location_lat":null,"title":"observe_content_security_report\/2","is_authoritative":true,"body":"<p>Handle a content security report<\/p>\n<p>Type:<\/p>\n<p><a href=\"\/id\/doc_developerguide_notifications#notification-notify-sync\">notify_sync<\/a><\/p>\n<p><code>controller_csp_report<\/code> forwards each accepted Reporting API CSP violation using\n<code>z_notifier:notify_sync\/2<\/code>. It checks that the request origin (or the Referer when\nthe origin is <code>null<\/code>) and the report URL are HTTPS URLs belonging to the site.\nThe report must have type <code>csp-violation<\/code> and a map as its body.<\/p>\n<p>Reports with a <code>blockedURL<\/code> or <code>sourceFile<\/code> using <code>safari-extension:<\/code>,\n<code>safari-web-extension:<\/code>, <code>chrome-extension:<\/code>, <code>moz-extension:<\/code> or\n<code>ms-browser-extension:<\/code> are ignored before notification delivery. Inline and eval\nviolations without an identifiable extension URL are still forwarded.<\/p>\n<p>Export <code>observe_content_security_report\/2<\/code> in an active module to receive reports,\nor <code>pid_observe_content_security_report\/3<\/code> for an observer that also receives the\nmodule process PID. Observer functions run synchronously in the request process;\ntheir return values are ignored. Keep handling brief or delegate expensive work\nto a worker. <code>mod_logging<\/code> uses the PID observer to store reports for the admin log.<\/p>\n<p>All report data is browser-supplied and untrusted. The <code>url<\/code> is checked for site\nmembership, but is not escaped for output. The body is passed through unchanged:\nvalidate field types and sanitize or escape data before storing or displaying it.\nThe origin and URL checks do not authenticate the sender.<\/p>\n<p><code>#content_security_report{}<\/code> properties:<\/p>\n<ul><li><code>type<\/code>: <code>binary<\/code>, currently <code>&lt;&lt;&quot;csp-violation&quot;&gt;&gt;<\/code>.<\/li><li><code>url<\/code>: <code>binary<\/code>, the top-level report URL, checked to belong to the site.<\/li><li><code>body<\/code>: <code>map<\/code>, the original report body with binary JSON keys, such as\n<code>&lt;&lt;&quot;blockedURL&quot;&gt;&gt;<\/code>, <code>&lt;&lt;&quot;sourceFile&quot;&gt;&gt;<\/code>, <code>&lt;&lt;&quot;documentURL&quot;&gt;&gt;<\/code>,\n<code>&lt;&lt;&quot;effectiveDirective&quot;&gt;&gt;<\/code>, <code>&lt;&lt;&quot;originalPolicy&quot;&gt;&gt;<\/code>, <code>&lt;&lt;&quot;sample&quot;&gt;&gt;<\/code>,\n<code>&lt;&lt;&quot;lineNumber&quot;&gt;&gt;<\/code> and <code>&lt;&lt;&quot;columnNumber&quot;&gt;&gt;<\/code>. Fields may be absent.<\/li><li><code>user_agent<\/code>: <code>binary<\/code>, taken from <code>body.user_agent<\/code> when present, otherwise\nfrom the request&#39;s <code>User-Agent<\/code> header, and converted to a binary.<\/li><\/ul>\n<p>See also: <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Headers\/Content-Security-Policy\/report-to\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Headers\/Content-Security-Policy\/report-to<\/a><\/p>","slug":"observe_content_security_report-2","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"06b09384a812437870a2887e935ed3a750bea98ebbd9c8286ff432cd61f4eca5","is_featured":false,"notification":{"arity":2,"callbacks":[{"arity":2,"name":"observe_content_security_report","signature":"observe_content_security_report\/2","variation":"observe"}],"name":"content_security_report","record":{"body":"undefined","type":"undefined","url":"\/undefined","user_agent":"undefined"}},"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":1122,"is_a":["meta","category"],"name":"notification","title":"Notifications","uri":"https:\/\/test.zotonic.com\/id\/1122"},"doc_source_path":"apps\/zotonic_core\/src\/behaviours\/zotonic_observer.erl","publication_start":"2026-05-20T10:35:07Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_core\/src\/behaviours\/zotonic_observer.erl","pivot_location_lng":null,"doc_source_kind":"notification","name":"doc_notification_content_security_report","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2026-05-20T10:35:07Z","uri":null,"doc_status":"current","is_dependent":false,"publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"c34f80c7ab6700e5d77ac5730deaae0e4710e159\n","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-10-19T13:18:08Z","title_slug":"observe_content_security_report-2"},"uri":"https:\/\/zotonic.com\/id\/2517","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2517"}},"status":"ok"}