object CSPNonce
A helper that renders the CSP nonce if it is present.
- Alphabetic
- By Inheritance
- CSPNonce
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- 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.
- 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.
- 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.
- 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.