Class: MediaWiktory::Wikipedia::Actions::Cspreport
- Defined in:
- lib/mediawiktory/wikipedia/actions/cspreport.rb
Overview
Used by browsers to report violations of the Content Security Policy. This module should never be used, except when used automatically by a CSP compliant web browser.
Usage:
api.cspreport.reportonly(value).perform # returns string with raw output
# or
api.cspreport.reportonly(value).response # returns output parsed and wrapped into Response object
See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#reportonly ⇒ self
Mark as being a report from a monitoring policy, not an enforced policy.
-
#source(value) ⇒ self
What generated the CSP header that triggered this report.
Methods inherited from Post
Methods inherited from Base
#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url
Methods included from GlobalParams
#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang
Instance Method Details
#reportonly ⇒ self
Mark as being a report from a monitoring policy, not an enforced policy
25 26 27 |
# File 'lib/mediawiktory/wikipedia/actions/cspreport.rb', line 25 def reportonly() merge(reportonly: 'true') end |
#source(value) ⇒ self
What generated the CSP header that triggered this report
33 34 35 |
# File 'lib/mediawiktory/wikipedia/actions/cspreport.rb', line 33 def source(value) merge(source: value.to_s) end |