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)
| 7 | |
| 8 | |
| 9 | def 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 | |
| 22 | class ContentSecurityPolicy(CallbackDict[str, str]): |
no test coverage detected