Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/src/components/file_entries/icon.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use include_flate::flate;
use leptos::{prelude::*, IntoView};
use leptos::{IntoView, prelude::*};

flate!(static LANGUAGES_MAP_JSON: str from "assets/associations/language.json");
flate!(static EXTENSIONS_MAP_JSON: str from "assets/associations/extension.json");
Expand Down Expand Up @@ -36,9 +36,9 @@ static FILENAMES_MAP: LazyLock<HashMap<String, String>> = LazyLock::new(|| {

extensions_name
.into_iter()
.chain(languages_map.into_iter())
.chain(languages_map)
.map(|(k, v)| (format!(".{k}"), v))
.chain(file_map.into_iter())
.chain(file_map)
.collect()
});

Expand Down
4 changes: 1 addition & 3 deletions server/src/fileserv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod archive;
use std::{
collections::HashMap,
ops::Not,
os,
path::{self, PathBuf},
};

Expand Down Expand Up @@ -133,8 +132,7 @@ async fn handle_archive(path: PathBuf, method: Option<&String>) -> impl IntoResp
(headers, Body::from_stream(stream)).into_response()
}

const UPLOAD_DISABLED: (StatusCode, &'static str) =
(StatusCode::FORBIDDEN, "Upload is not enabled");
const UPLOAD_DISABLED: (StatusCode, &str) = (StatusCode::FORBIDDEN, "Upload is not enabled");

fn safe_join_path(base_dir: &path::Path, path: &str) -> Option<PathBuf> {
path.contains("..").not().then(|| base_dir.join(path))
Expand Down
Loading