Class: MediaWiktory::Wikipedia::Actions::Cspreport

Inherits:
Post
  • Object
show all
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

Methods inherited from Post

#perform

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

#reportonlyself

Mark as being a report from a monitoring policy, not an enforced policy

Returns:

  • (self)


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

Parameters:

  • value (String)

Returns:

  • (self)


33
34
35
# File 'lib/mediawiktory/wikipedia/actions/cspreport.rb', line 33

def source(value)
  merge(source: value.to_s)
end