Dump a Content Security Policy header. These are structured into policies such as "default-src 'self'; script-src 'self'". .. versionadded:: 1.0.0 Support for Content Security Policy headers was added.
(header: ds.ContentSecurityPolicy)
| 288 | |
| 289 | |
| 290 | def dump_csp_header(header: ds.ContentSecurityPolicy) -> str: |
| 291 | """Dump a Content Security Policy header. |
| 292 | |
| 293 | These are structured into policies such as "default-src 'self'; |
| 294 | script-src 'self'". |
| 295 | |
| 296 | .. versionadded:: 1.0.0 |
| 297 | Support for Content Security Policy headers was added. |
| 298 | |
| 299 | """ |
| 300 | return "; ".join(f"{key} {value}" for key, value in header.items()) |
| 301 | |
| 302 | |
| 303 | def parse_list_header(value: str) -> list[str]: |