Skip to content
Snippets Groups Projects
Verified Commit 567dcc3c authored by Volkor Barbarian Warrior's avatar Volkor Barbarian Warrior
Browse files

refactor: cleaning up random comments and newlines

This is mostly a test to see if I fixed git being REALLY slow at uploading over ssh
parent 1dfdf629
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ pub async fn engine_1<S>(sqlconn: &Pool<Sqlite>, filename: S) -> i32
where
S: AsRef<str>,
{
// Read the list of unsafe mimetypes from the config
// Read the file expiry settings from the config
let file_expiry_min: i32 = CONFIG
.get_int("operations.file_expiry_min")
.expect("Couldn't find 'file_expiry_min' in config. :(")
......
......@@ -94,4 +94,3 @@ pub async fn list_files(req: &mut Request, res: &mut Response) {
render_template(res, headers, template_filename, template, status_code).await
}
......@@ -10,7 +10,7 @@ use super::guess_ip;
use crate::{
db, engine,
handlers::{is_mimetype_banned, render_template, TemplateStruct},
CONFIG, SQLITE,
CONFIG, SQLITE, MAGIC,
};
/// This file handles (heh) uploading files to the server.
......@@ -52,10 +52,9 @@ pub async fn upload(req: &mut Request, res: &mut Response) {
engine::generate_filename(length, file.name().unwrap_or("file").to_string()).await;
// Guess the mimetype from the file.
let file_path = file.path();
let mimetype = tree_magic_mini::from_filepath(&file_path)
.unwrap_or("text/plain");
.unwrap_or("text/plain");
tracing::debug!("upload(mimetype): {:?}", mimetype);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment