#axum-middleware #helmet #security #axum

axum-helmet

HTTP security headers middleware core for axum web framework

2 unstable releases

0.2.0 Apr 2, 2025
0.1.0 Jan 5, 2024

#819 in HTTP server

Download history 239/week @ 2025-05-04 249/week @ 2025-05-11 325/week @ 2025-05-18 264/week @ 2025-05-25 158/week @ 2025-06-01 295/week @ 2025-06-08 289/week @ 2025-06-15 506/week @ 2025-06-22 255/week @ 2025-06-29 147/week @ 2025-07-06 307/week @ 2025-07-13 216/week @ 2025-07-20 312/week @ 2025-07-27 355/week @ 2025-08-03 277/week @ 2025-08-10 278/week @ 2025-08-17

1,239 downloads per month
Used in crudcrate

MIT license

74KB
945 lines

axum-core - Security Middleware for the axum web framework

crate docs

It works by setting HTTP headers for you. These headers can help protect your app from some well-known web vulnerabilities:

Usage

Add this to your Cargo.toml:

[dependencies]
axum-helmet = "0.1"

Example

use axum::{self, Router};
use axum_helmet::Helmet;

let app = Router::new()
    .route("/", axum::handler::get(|| async { "Hello, World!" }))
    .layer(Helmet::default());

// ...

License

This project is licensed under the MIT license.

Dependencies

~5–15MB
~153K SLoC