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 <d.csapak@proxmox.com>
This commit is contained in:
parent
a83674ad48
commit
7fde1a71ca
|
@ -243,7 +243,7 @@ pub const API_METHOD_UPLOAD_BLOB: ApiMethod = ApiMethod::new(
|
||||||
&sorted!([
|
&sorted!([
|
||||||
("file-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA),
|
("file-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA),
|
||||||
("encoded-size", false, &IntegerSchema::new("Encoded blob size.")
|
("encoded-size", false, &IntegerSchema::new("Encoded blob size.")
|
||||||
.minimum((std::mem::size_of::<DataBlobHeader>() as isize) +1)
|
.minimum(std::mem::size_of::<DataBlobHeader>() as isize)
|
||||||
.maximum(1024*1024*16+(std::mem::size_of::<EncryptedDataBlobHeader>() as isize))
|
.maximum(1024*1024*16+(std::mem::size_of::<EncryptedDataBlobHeader>() as isize))
|
||||||
.schema()
|
.schema()
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue