From 736d41513bcce41d497eb31368c42f8df2569b00 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 17 Apr 2025 17:17:56 +0200 Subject: [PATCH] fix --- src/main.rs | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index bb29f7e..84e0936 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,29 +9,27 @@ pub async fn index() -> String { #[get("/rootfs//rootfs.tar.xz")] pub async fn rootfs_tar(arch: &str) -> DataResponse { match arch { - "aarch64" => { - DataResponse::new_file("./tar/aarch64.tar.xz", "application/tar".to_string(), Some(60 * 60)) - }, - "x86_64" => { - DataResponse::new_file("./tar/x86_64.tar.xz", "application/tar".to_string(), Some(60 * 60)) - }, - _ => { - DataResponse::new("Weird arch".as_bytes().to_vec(), "text/plain".to_string(), None) - } + "aarch64" | "arm64" => DataResponse::new_file( + "./tar/aarch64.tar.xz", + "application/tar".to_string(), + Some(60 * 60), + ), + "x86_64" | "amd64" => DataResponse::new_file( + "./tar/x86_64.tar.xz", + "application/tar".to_string(), + Some(60 * 60), + ), + _ => DataResponse::new( + "Weird arch".as_bytes().to_vec(), + "text/plain".to_string(), + None, + ), } } - #[launch] async fn rocket() -> _ { env_logger::init(); - rocket::build() - .mount( - "/", - routes![ - index, - rootfs_tar - ], - ) + rocket::build().mount("/", routes![index, rootfs_tar]) }