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

Function dump_csp_header

src/werkzeug/http.py:290–300  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

288
289
290def 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
303def parse_list_header(value: str) -> list[str]:

Callers 1

to_headerMethod · 0.85

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected