Class: CspViolationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- CspViolationsController
- Defined in:
- lib/generators/rockstart/security/templates/csp_violations_controller.rb
Overview
Handle violations from the Content Security Policy
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/generators/rockstart/security/templates/csp_violations_controller.rb', line 7 def create report_base = JSON.parse(request.body.read) if report_base.key? "csp-report" report = report_base["csp-report"] = (report) # Post message using Lograge formatter Rails.logger.error(.to_json) end head :ok end |