https://github.com/lllama/sanickit/blob/4d000f4ad443f068e78add19bb6995e6358512a2/src/sanickit/template/default/src/middleware/htmx.py#L12 I believe you can use [florimondmanca/asgi-htmx: HTMX integration for ASGI applications](https://github.com/florimondmanca/asgi-htmx/) instead of that block. It's a dependency-free module.