Compare commits
3 commits
d58e46d65e
...
984724a465
Author | SHA1 | Date | |
---|---|---|---|
984724a465 | |||
4ad6f45379 | |||
607d58df84 |
1 changed files with 3 additions and 3 deletions
|
@ -57,11 +57,11 @@ impl super::FileSystemLike for RealFileSystem {
|
|||
|
||||
impl RealFileSystem {
|
||||
fn validate(&self, path: &Path) -> super::Result<()> {
|
||||
let path = self.clean_path(path)?;
|
||||
if !path.starts_with(&self.base) {
|
||||
let canon = self.clean_path(path)?;
|
||||
if !canon.starts_with(&self.base) {
|
||||
return Err(super::Error::PathTraversal {
|
||||
base: self.base.clone(),
|
||||
path,
|
||||
path: canon.to_path_buf(),
|
||||
});
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue