mirror of
https://github.com/YGGverse/nexy.git
synced 2026-03-31 09:15:28 +00:00
use shared var name
This commit is contained in:
parent
819a522268
commit
8c742ed9a1
1 changed files with 4 additions and 4 deletions
|
|
@ -48,11 +48,11 @@ impl Public {
|
|||
let mut p = PathBuf::from(&self.public_dir);
|
||||
p.push(query.trim_matches('/'));
|
||||
match p.canonicalize() {
|
||||
Ok(c) => {
|
||||
if !c.starts_with(&self.public_dir) {
|
||||
return callback(Response::AccessDenied { query, path: c });
|
||||
Ok(path) => {
|
||||
if !path.starts_with(&self.public_dir) {
|
||||
return callback(Response::AccessDenied { query, path });
|
||||
}
|
||||
c
|
||||
path
|
||||
}
|
||||
Err(e) => {
|
||||
return callback(Response::NotFound {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue