mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 16:49:58 -07:00
global: snapshot
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user