Secure.set_headers()
Apply configured headers synchronously to response.
Usage
Secure.set_headers(response)This method is strictly sync-only. It is suitable for synchronous frameworks or sync response objects in async frameworks.
Supported Patterns
response.set_header(name, value)(synchronous).response.headers.set(name, value)(Werkzeug-style headers container).response.headers[name] = value(mapping interface).
Parameters
response: ResponseProtocol-
Response object implementing either
SetHeaderProtocolorHeadersProtocol.
Raises
RuntimeError-
If an async setter is detected (for example an async method is used in a sync context).
AttributeError-
If the response lacks both
.set_headerand.headers, or if.headersdoes not support setting values. HeaderSetError- If setting an individual header fails.