Crates.io | ntex-helmet |
lib.rs | ntex-helmet |
version | 0.1.3 |
source | src |
created_at | 2023-12-30 01:40:02.254064 |
updated_at | 2024-01-05 20:31:39.928547 |
description | HTTP security headers middleware for ntex-web |
homepage | https://github.com/danielkov/ntex-helmet |
repository | https://github.com/danielkov/ntex-helmet |
max_upload_size | |
id | 1083821 |
size | 50,813 |
ntex-helmet
- Security Middleware for ntex
web frameworkntex-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:
Add this to your Cargo.toml
:
[dependencies]
ntex-helmet = "0.1"
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()));
// ...
}
This project is licensed under the MIT license.