Add lang option

This commit is contained in:
int 80h
2020-06-08 00:05:45 -04:00
parent 543ce4c15e
commit ac3b98d72f
5 changed files with 10 additions and 3 deletions

View File

@@ -296,7 +296,10 @@ async fn handle_connection(
return Ok(());
}
let mime = get_mime(&path);
let mut mime = get_mime(&path);
if mime == "text/gemini" && srv.server.lang.is_some() {
mime += &("; lang=".to_string() + &srv.server.lang.to_owned().unwrap());
}
if !mime.starts_with("text/") {
logger::logger(con.peer_addr, Status::Success, &request);
get_binary(con, path, mime).await?;