From 02496d220a4d4e073fc2e2d075bf4536e00e935e Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Thu, 30 Jan 2025 20:20:42 +0300 Subject: [PATCH] set error message --- src/path.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/path.rs b/src/path.rs index bd7de1c..bd3234c 100644 --- a/src/path.rs +++ b/src/path.rs @@ -21,7 +21,7 @@ where let s = Path::::from_request_parts(parts, state).await?.0; if s.as_ref().contains("..") || s.as_ref().contains('/') { - return Err(SafePathRejection::Test); + return Err(SafePathRejection::Invalid); } Ok(SafePath(s)) @@ -30,8 +30,8 @@ where #[derive(Error, Debug)] pub enum SafePathRejection { - #[error("test")] - Test, + #[error("path contains invalid characters")] + Invalid, #[error(transparent)] PathRejection(#[from] PathRejection), }