Crates.io | path_ratchet |
lib.rs | path_ratchet |
version | 0.3.0 |
source | src |
created_at | 2023-12-04 16:38:16.302383 |
updated_at | 2023-12-09 10:12:25.30921 |
description | Prevent path traversal attacks at type level |
homepage | |
repository | https://github.com/TheAlgorythm/path-ratchet |
max_upload_size | |
id | 1057789 |
size | 21,307 |
Path
RatchetPrevent path traversal attacks at type level.
use std::path::PathBuf;
use path_ratchet::prelude::*;
let user_input = "/etc/shadow";
let mut filename = PathBuf::from("/tmp");
filename.push_component(SingleComponentPath::new(user_input).unwrap());