#axum #middleware #helmet #security #rust

axum-helmet

HTTP security headers middleware core for axum web framework

2 unstable releases

new 0.2.0 Apr 2, 2025
0.1.0 Jan 5, 2024

#1077 in HTTP server

Download history 256/week @ 2024-12-15 41/week @ 2024-12-22 53/week @ 2024-12-29 89/week @ 2025-01-05 144/week @ 2025-01-12 180/week @ 2025-01-19 198/week @ 2025-01-26 198/week @ 2025-02-02 170/week @ 2025-02-09 157/week @ 2025-02-16 154/week @ 2025-02-23 288/week @ 2025-03-02 198/week @ 2025-03-09 238/week @ 2025-03-16 296/week @ 2025-03-23 309/week @ 2025-03-30

1,043 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
~111K SLoC