Adjust CSP reporting
parent
77bb85bb67
commit
bb76d99ef5
|
@ -94,7 +94,8 @@ class DashboardController < ApplicationController
|
|||
rescue
|
||||
report = { problem: "Crashed while parsing report" }
|
||||
end
|
||||
Rollbar.info("CSP Violation", report)
|
||||
# We get too many CSP reports.
|
||||
# Rollbar.info("CSP Violation", report)
|
||||
|
||||
render json: report
|
||||
end
|
||||
|
|
|
@ -20,14 +20,15 @@ describe DashboardController do
|
|||
end
|
||||
|
||||
it "receives CSP violation reports (malformed JSON)" do
|
||||
expect(Rollbar).to receive(:info)
|
||||
.with("CSP Violation", { problem: "Crashed while parsing report" })
|
||||
# expect(Rollbar).to receive(:info)
|
||||
# .with("CSP Violation", { problem: "Crashed while parsing report" })
|
||||
post :csp_reports, body: "NOT JSON ! ! !"
|
||||
expect(json).to eq(problem: "Crashed while parsing report")
|
||||
end
|
||||
|
||||
it "receives CSP violation reports (malformed JSON)" do
|
||||
expect(Rollbar).to receive(:info).with("CSP Violation", {})
|
||||
post :csp_reports, body: {}.to_json, params: { format: :json }
|
||||
expect(json).to eq({})
|
||||
end
|
||||
|
||||
it "creates a new user" do
|
||||
|
|
Loading…
Reference in New Issue