4 releases

0.1.3 Jan 5, 2024
0.1.2 Dec 30, 2023
0.1.1 Dec 30, 2023
0.1.0 Dec 30, 2023

#8 in #ntex

Download history 2/week @ 2023-12-24 4/week @ 2024-02-25 6/week @ 2024-03-10 1/week @ 2024-03-17 67/week @ 2024-03-31

74 downloads per month

MIT license

115KB
2K SLoC

ntex-helmet - Security Middleware for ntex web framework

crate docs

ntex-helmet is a security middleware for the ntex web framework. It's based on the helmet middleware for Node.js.

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]
ntex-helmet = "0.1"

Example

use ntex::web::{self, App, HttpResponse};
use ntex_helmet::Helmet;

#[ntex::main]
fn main() {
    let app = App::new()
        .wrap(Helmet::default())
        .service(web::resource("/").to(|| HttpResponse::Ok()));

    // ...
}

License

This project is licensed under the MIT license.

Dependencies

~15–51MB
~847K SLoC