If there's no extension or unknown file type it will send text/plain
This commit is contained in:
@@ -27,9 +27,12 @@ mod tls;
|
|||||||
|
|
||||||
fn get_mime(path: &PathBuf) -> String {
|
fn get_mime(path: &PathBuf) -> String {
|
||||||
let mut mime = "text/gemini".to_string();
|
let mut mime = "text/gemini".to_string();
|
||||||
|
if path.is_dir() {
|
||||||
|
return mime;
|
||||||
|
}
|
||||||
let ext = match path.extension() {
|
let ext = match path.extension() {
|
||||||
Some(p) => p.to_str().unwrap(),
|
Some(p) => p.to_str().unwrap(),
|
||||||
None => return mime,
|
None => return "text/plain".to_string(),
|
||||||
};
|
};
|
||||||
|
|
||||||
mime = match ext {
|
mime = match ext {
|
||||||
|
|||||||
Reference in New Issue
Block a user