summaryrefslogtreecommitdiff
path: root/app/controllers/csp_reports_controller.rb
blob: 08cbc98714996b70d49d0b8989bbc01b1c8927e4 (plain)
1
2
3
4
5
6
7
8
9
10
class CspReportsController < ApplicationController
  # Browsers POST application/csp-report with no CSRF token, no session.
  skip_before_action :verify_authenticity_token

  def create
    report = request.body.read(8192)
    Rails.logger.warn("CSP violation: #{report}") if report.present?
    head :no_content
  end
end