index : static-web-server.git

ascending towards madness

author Jose Quintana <joseluisquintana20@gmail.com> 2021-07-30 6:15:33.0 +00:00:00
committer Jose Quintana <joseluisquintana20@gmail.com> 2021-07-30 6:15:33.0 +00:00:00
commit
8fc181201e31cb4222a9be7f2087aee924dc028c [patch]
tree
8528b834d1c2d1ca5a8634e7a0f08bc9691cd65b
parent
fa32375fccb8f7daecbfbb701fe28b84fe17e4b0
download
8fc181201e31cb4222a9be7f2087aee924dc028c.tar.gz

refactor: remove needless borrow on static file and handle modules



Diff

 src/handler.rs      | 2 +-
 src/static_files.rs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/handler.rs b/src/handler.rs
index ee03ef7..4abb266 100644
--- a/src/handler.rs
+++ b/src/handler.rs
@@ -76,7 +76,7 @@ impl RequestHandler {

                    // Append `Cache-Control` headers for web assets
                    if self.opts.cache_control_headers {
                        control_headers::append_headers(&uri_path, &mut resp);
                        control_headers::append_headers(uri_path, &mut resp);
                    }

                    // Append security headers
diff --git a/src/static_files.rs b/src/static_files.rs
index 6c9974f..a9371d0 100644
--- a/src/static_files.rs
+++ b/src/static_files.rs
@@ -234,7 +234,7 @@ async fn read_directory_entries(
        );
    }

    let current_path = percent_decode_str(&base_path).decode_utf8()?.to_owned();
    let current_path = percent_decode_str(base_path).decode_utf8()?.to_owned();
    let dirs_str = if dirs_count == 1 {
        "directory"
    } else {