From 7fde1a71caa197ea0824f3366f8c613813341052 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 27 Jul 2020 13:22:26 +0200 Subject: [PATCH] upload_chunk: allow upload of empty blobs a blob can be empty (e.g. an empty pct fw conf), so we have to set the minimum size to the header size Signed-off-by: Dominik Csapak --- src/api2/backup/upload_chunk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api2/backup/upload_chunk.rs b/src/api2/backup/upload_chunk.rs index 483ced3c..ec954721 100644 --- a/src/api2/backup/upload_chunk.rs +++ b/src/api2/backup/upload_chunk.rs @@ -243,7 +243,7 @@ pub const API_METHOD_UPLOAD_BLOB: ApiMethod = ApiMethod::new( &sorted!([ ("file-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA), ("encoded-size", false, &IntegerSchema::new("Encoded blob size.") - .minimum((std::mem::size_of::() as isize) +1) + .minimum(std::mem::size_of::() as isize) .maximum(1024*1024*16+(std::mem::size_of::() as isize)) .schema() )