set error message
This commit is contained in:
parent
d1731fb01d
commit
02496d220a
1 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ where
|
||||||
let s = Path::<T>::from_request_parts(parts, state).await?.0;
|
let s = Path::<T>::from_request_parts(parts, state).await?.0;
|
||||||
|
|
||||||
if s.as_ref().contains("..") || s.as_ref().contains('/') {
|
if s.as_ref().contains("..") || s.as_ref().contains('/') {
|
||||||
return Err(SafePathRejection::Test);
|
return Err(SafePathRejection::Invalid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(SafePath(s))
|
Ok(SafePath(s))
|
||||||
|
@ -30,8 +30,8 @@ where
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
pub enum SafePathRejection {
|
pub enum SafePathRejection {
|
||||||
#[error("test")]
|
#[error("path contains invalid characters")]
|
||||||
Test,
|
Invalid,
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
PathRejection(#[from] PathRejection),
|
PathRejection(#[from] PathRejection),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue