MCPcopy
hub / github.com/pallets/werkzeug / csp_property

Function csp_property

src/werkzeug/datastructures/csp.py:9–19  ·  view source on GitHub ↗

Return a new property object for a content security policy header. Useful if you want to add support for a csp extension in a subclass.

(key: str)

Source from the content-addressed store, hash-verified

7
8
9def csp_property(key: str) -> t.Any:
10 """Return a new property object for a content security policy header.
11 Useful if you want to add support for a csp extension in a
12 subclass.
13 """
14 return property(
15 lambda x: x._get_value(key),
16 lambda x, v: x._set_value(key, v),
17 lambda x: x._del_value(key),
18 f"accessor for {key!r}",
19 )
20
21
22class ContentSecurityPolicy(CallbackDict[str, str]):

Callers 1

Calls 3

_get_valueMethod · 0.80
_set_valueMethod · 0.80
_del_valueMethod · 0.80

Tested by

no test coverage detected