Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vinhjaxt committed Apr 17, 2022
1 parent e51ec95 commit 7b81b82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions public/index
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello world
11 changes: 4 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,14 @@ async fn main() -> std::io::Result<()> {
.service(
actix_files::Files::new("/", &public_folder)
.path_filter(move |path, _| {
let ext = path.extension();
if ext.is_none() {
return true;
}
let ext = ext.unwrap().to_str().unwrap().to_lowercase();
let ext = match path.extension() {
Some(ext) => ext.to_str().unwrap().to_lowercase(),
None => return true
};
if is_include_exts {
let include_exts = include_exts.clone();
return include_exts.contains(&ext);
}
if is_exclude_exts {
let exclude_exts = exclude_exts.clone();
return !exclude_exts.contains(&ext);
}
true
Expand Down

0 comments on commit 7b81b82

Please sign in to comment.