Packages

object CSPNonce

A helper that renders the CSP nonce if it is present.

Source
CSPNonce.scala
See also

play.api.mvc.request.RequestAttrKey.CSPNonce

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CSPNonce
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def apply()(implicit request: RequestHeader): String

    Gets nonce if RequestAttr.CSPNonce has a nonce value set.

    Gets nonce if RequestAttr.CSPNonce has a nonce value set.

    request

    the request containing the CSP nonce attribute

    returns

    nonce value, or exception if not set.

  2. def attr(implicit request: RequestHeader): Html

    Gets Html containing "nonce=$nonce" attribute value.

    Gets Html containing "nonce=$nonce" attribute value.

    request

    the request containing the CSP nonce attribute

    returns

    Html with nonce attribute or empty string if not defined.

  3. def attrMap(implicit request: RequestHeader): Map[String, String]

    Gets nonce attribute if RequestAttr.CSPNonce has a nonce value set.

    Gets nonce attribute if RequestAttr.CSPNonce has a nonce value set.

    request

    the request containing the CSP nonce attribute

    returns

    Map("nonce" -> nonce), or Map.empty if not set.

  4. def get(implicit request: RequestHeader): Option[String]

    Gets nonce if RequestAttr.CSPNonce has a nonce value set.

    Gets nonce if RequestAttr.CSPNonce has a nonce value set.

    request

    the request containing the CSP nonce attribute

    returns

    Some(nonce) or None if not set.