api: always use complete file names (including add exctensions)
This commit is contained in:
@ -242,13 +242,15 @@ fn upload_blob(
|
||||
rpcenv: Box<dyn RpcEnvironment>,
|
||||
) -> Result<BoxFut, Error> {
|
||||
|
||||
let mut file_name = tools::required_string_param(¶m, "file-name")?.to_owned();
|
||||
let file_name = tools::required_string_param(¶m, "file-name")?.to_owned();
|
||||
let encoded_size = tools::required_integer_param(¶m, "encoded-size")? as usize;
|
||||
|
||||
|
||||
let env: &BackupEnvironment = rpcenv.as_ref();
|
||||
|
||||
file_name.push_str(".blob");
|
||||
if !file_name.ends_with(".blob") {
|
||||
bail!("wrong blob file extension: '{}'", file_name);
|
||||
}
|
||||
|
||||
let env2 = env.clone();
|
||||
let env3 = env.clone();
|
||||
|
Reference in New Issue
Block a user