fix(server): change the config data type for serve route

This commit is contained in:
Orhun Parmaksız 2021-11-07 17:03:00 +03:00
parent b12ff1f579
commit 7797180937
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -29,8 +29,9 @@ async fn index() -> impl Responder {
async fn serve( async fn serve(
request: HttpRequest, request: HttpRequest,
file: web::Path<String>, file: web::Path<String>,
config: web::Data<Config>, config: web::Data<Arc<Mutex<Config>>>,
) -> Result<HttpResponse, Error> { ) -> Result<HttpResponse, Error> {
let config = config.lock().expect("cannot acquire config");
let path = config.server.upload_path.join(&*file); let path = config.server.upload_path.join(&*file);
let mut path = util::glob_match_file(path)?; let mut path = util::glob_match_file(path)?;
let mut paste_type = PasteType::File; let mut paste_type = PasteType::File;