Sha256: 037a0d7b7c3e833724400c506813f727a7049e6e2534de03d93f0be8298b8142
Contents?: true
Size: 759 Bytes
Versions: 3
Compression:
Stored size: 759 Bytes
Contents
require_dependency "csp_report/application_controller" class CspReport::CspReportsController < ApplicationController # The browser submitting the report will not have any CSRF token skip_before_filter :verify_authenticity_token #Only provided as an API respond_to :json def index @reports = CspReport::CspReport.all end def create param = request.request_parameters()['csp-report'] report = CspReport::CspReport.new do |r| r.document_uri = param['document-uri'] r.referrer = param['referrer'] r.violated_directive = param['violated-directive'] r.original_policy = param['original-policy'] r.blocked_uri = param['blocked-uri'] end report.save! render status: 200, nothing: true end end
Version data entries
3 entries across 3 versions & 1 rubygems