use shared var name

This commit is contained in:
yggverse 2025-07-04 11:33:31 +03:00
parent 819a522268
commit 8c742ed9a1

View file

@ -48,11 +48,11 @@ impl Public {
let mut p = PathBuf::from(&self.public_dir); let mut p = PathBuf::from(&self.public_dir);
p.push(query.trim_matches('/')); p.push(query.trim_matches('/'));
match p.canonicalize() { match p.canonicalize() {
Ok(c) => { Ok(path) => {
if !c.starts_with(&self.public_dir) { if !path.starts_with(&self.public_dir) {
return callback(Response::AccessDenied { query, path: c }); return callback(Response::AccessDenied { query, path });
} }
c path
} }
Err(e) => { Err(e) => {
return callback(Response::NotFound { return callback(Response::NotFound {