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