CSPNonce

views.html.helper.CSPNonce
object CSPNonce

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

Attributes

See also
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
CSPNonce.type

Members list

Value members

Concrete methods

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.

Value parameters

request

the request containing the CSP nonce attribute

Attributes

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.

Value parameters

request

the request containing the CSP nonce attribute

Attributes

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.

Value parameters

request

the request containing the CSP nonce attribute

Attributes

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.

Value parameters

request

the request containing the CSP nonce attribute

Attributes

Returns

Some(nonce) or None if not set.