https://github.com/banool/tower-default-headers-rs
tower-compatible middleware to set default HTTP response headers
https://github.com/banool/tower-default-headers-rs
Last synced: about 1 year ago
JSON representation
tower-compatible middleware to set default HTTP response headers
- Host: GitHub
- URL: https://github.com/banool/tower-default-headers-rs
- Owner: banool
- License: mit
- Created: 2024-03-18T12:44:25.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-18T13:03:27.000Z (about 2 years ago)
- Last Synced: 2025-03-14T23:43:25.192Z (over 1 year ago)
- Language: Rust
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tower-default-headers-rs
[](https://gitlab.com/jokeyrhyme/tower-default-headers-rs) [](https://gitlab.com/jokeyrhyme/tower-default-headers-rs/-/pipelines?ref=main) [](https://crates.io/crates/tower-default-headers) [](https://docs.rs/tower-default-headers)
Tower compatible middleware to set default HTTP response headers.
If you need to set just a small, known set of headers, just use [SetResponseHeaderLayer](https://docs.rs/tower-http/latest/tower_http/set_header/struct.SetResponseHeaderLayer.html) from [tower-http](https://docs.rs/tower-http/latest/tower_http/index.html).
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](https://gitlab.com/jokeyrhyme/tower-default-headers-rs/-/issues/2) to see if the original repo has been updated.
## See also
- tower: [source code](https://github.com/tower-rs/tower) [crate](https://crates.io/crates/tower)
- tokio blog post: [Inventing the `Service` trait](https://tokio.rs/blog/2021-05-14-inventing-the-service-trait)
- owasp-headers-rs: https://github.com/banool/owasp-headers-rs