api3/admin/datastore/upload_catar.rs: verify content type ("application/x-proxmox-backup-catar")

This commit is contained in:
Dietmar Maurer
2019-01-17 12:43:29 +01:00
parent 06aeb76a5c
commit 83bdac1e3b
5 changed files with 18 additions and 6 deletions

View File

@ -17,7 +17,7 @@ impl HttpClient {
}
}
pub fn upload(&self, body: Body, path: &str) -> Result<(), Error> {
pub fn upload(&self, content_type: &str, body: Body, path: &str) -> Result<(), Error> {
let client = Client::new();
@ -30,6 +30,7 @@ impl HttpClient {
.method("POST")
.uri(url)
.header("User-Agent", "proxmox-backup-client/1.0")
.header("Content-Type", content_type)
.body(body)?;
let future = client