Test
Some checks failed
Build Project / test (push) Failing after 6m9s

This commit is contained in:
2025-02-06 17:27:59 +00:00
parent 31b90e223f
commit 0257434b26
8 changed files with 60 additions and 41 deletions

View File

@@ -13,7 +13,7 @@ async fn upload_firmware(
body: web::Bytes,
) -> impl Responder {
let (device, config, version) = path.into_inner();
let version = version.replace(".", "-");
let version = version.replace('.', "-");
let firmware_root_path = &data.firmwares_path;
@@ -34,8 +34,7 @@ async fn upload_firmware(
debug!("{x:?}");
HttpResponse::Ok().body(format!(
"Firmware version {} uploaded successfully",
version
"Firmware version {version} uploaded successfully"
))
}
@@ -63,7 +62,7 @@ async fn serve_firmware(
data: web::Data<AppState>,
) -> impl Responder {
let (product, config, version) = path.into_inner();
let version = version.replace(".", "-").replace("_", "-");
let version = version.replace(['.', '_'], "-");
let fw_root_path = &data.firmwares_path;
let file_path = PathBuf::from(format!("{product}/firmware_{config}_{version}.bin"));
let file_path = fw_root_path.join(&file_path);