c

play.filters.csp

DefaultCSPProcessor

class DefaultCSPProcessor extends CSPProcessor

The default CSP processor. This handles processing of a CSP Nonce and hashes into a Content-Security-Policy series of directives, based off the CSPConfig.

If a request has the attribute RequestAttrKey.CSPNonce, then that nonce is used. Otherwise, a nonce is generated from 16 bytes of SecureRandom.

Source
CSPProcessor.scala
Linear Supertypes
CSPProcessor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefaultCSPProcessor
  2. CSPProcessor
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DefaultCSPProcessor(config: CSPConfig)

    config

    the CSPConfig to use for processing rules.

    Annotations
    @Inject()

Value Members

  1. def process(requestHeader: RequestHeader): Option[CSPResult]

    Inspects the request header, and returns a CSPResult if the request should be subject to CSP processing.

    Inspects the request header, and returns a CSPResult if the request should be subject to CSP processing.

    If the request header has a CSP Nonce already defined, then the processor will carry the existing nonce through in the result, otherwise a new nonce will be generated.

    requestHeader

    a request header

    returns

    Some(CSPResult) if the processor is enabled for this request, otherwise None

    Definition Classes
    CSPProcessor