mirror of
https://github.com/YGGverse/nexy.git
synced 2026-03-31 17:25:27 +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);
|
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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue