Tower compatible middleware to set default HTTP response headers.
If you need to set just a small, known set of headers, just use SetResponseHeaderLayer from tower-http.
Forked from: https://gitlab.com/jokeyrhyme/tower-default-headers-rs. Updated to be compatible with Axum 0.7 and friends. If you're reading this in the future, see this issue to see if the original repo has been updated.
-
tower: source code crate
-
tokio blog post: Inventing the
Servicetrait -
owasp-headers-rs: https://github.com/banool/owasp-headers-rs