global: snapshot

This commit is contained in:
k
2024-10-20 18:31:43 +02:00
parent ffa4871035
commit 5b9d599e83
47 changed files with 666 additions and 251 deletions

View File

@@ -149,7 +149,7 @@ impl HeaderMapUtils for HeaderMap {
"json" => self.insert_content_type_application_json(),
"html" => self.insert_content_type_text_html(),
"css" => self.insert_content_type_text_css(),
"txt" => self.insert_content_type_text_plain(),
"toml" | "txt" => self.insert_content_type_text_plain(),
"pdf" => self.insert_content_type_application_pdf(),
"woff2" => self.insert_content_type_font_woff2(),
"ico" => self.insert_content_type_image_icon(),

View File

@@ -19,7 +19,12 @@ use super::minify_js;
const WEBSITE_PATH: &str = "../website/";
pub async fn file_handler(headers: HeaderMap, path: extract::Path<String>) -> Response {
let path = path.0.replace("..", "").replace("\\", "");
let mut path = path.0.replace("..", "").replace("\\", "");
if path.ends_with("Cargo.toml") {
path = "../server/Cargo.toml".to_owned();
}
let mut path = str_to_path(&path);
if !path.exists() {