Skip to content

Commit

Permalink
feature: support http static file server
Browse files Browse the repository at this point in the history
  • Loading branch information
listenLearning committed Jun 26, 2024
1 parent 07754ae commit c84bab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ allow = [
"MIT",
"Apache-2.0",
"Unicode-DFS-2016",
"BSD-2-Clause",
"BSD-3-Clause",
#"Apache-2.0 WITH LLVM-exception",
]
# The confidence threshold for detecting a license from license text.
Expand Down
4 changes: 2 additions & 2 deletions src/process/http_serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ async fn file_handler(
let p = std::path::Path::new(&state.path).join(path);
info!("Reading file {:?}", p);
if !p.exists() {
return (
(
StatusCode::NOT_FOUND,
format!("File not found:{:?}", p.display()),
);
)
} else {
match tokio::fs::read_to_string(p).await {
Ok(content) => {
Expand Down

0 comments on commit c84bab4

Please sign in to comment.