python_template_server.middleware.security_headers_middleware

Middleware to add security headers to all responses.

Classes

SecurityHeadersMiddleware(app, hsts_max_age, csp)

Middleware to add security headers to all responses.

class python_template_server.middleware.security_headers_middleware.SecurityHeadersMiddleware(app, hsts_max_age, csp)[source]

Middleware to add security headers to all responses.

__init__(app, hsts_max_age, csp)[source]

Initialize the SecurityHeadersMiddleware.

async dispatch(request, call_next)[source]

Add security headers to the response.

Return type:

Response