#axum #middleware #helmet #security #rust

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

#1134 in HTTP server

Download history 192/week @ 2025-01-27 191/week @ 2025-02-03 162/week @ 2025-02-10 154/week @ 2025-02-17 158/week @ 2025-02-24 287/week @ 2025-03-03 206/week @ 2025-03-10 226/week @ 2025-03-17 301/week @ 2025-03-24 316/week @ 2025-03-31 352/week @ 2025-04-07 394/week @ 2025-04-14 242/week @ 2025-04-21 163/week @ 2025-04-28 252/week @ 2025-05-05 225/week @ 2025-05-12

905 downloads per month

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–11MB
~108K SLoC