From cf72b882318eb628f6c56895f29953c8823b61e4 Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Wed, 23 Feb 2022 10:23:46 +0000 Subject: [PATCH] Output length and set content type --- src/upload.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/upload.rs b/src/upload.rs index 0e1010e..ebed1a2 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -69,7 +69,11 @@ pub fn upload_db(db_path:&String, lms:&String) { match file.metadata() { Ok(meta) => { let buffered_reader = BufReader::new(file); - match ureq::put(&format!("http://{}:{}/upload", lms, port)).set("Content-Length", &meta.len().to_string()).send(buffered_reader) { + log::info!("Length: {}", meta.len()); + match ureq::put(&format!("http://{}:{}/upload", lms, port)) + .set("Content-Length", &meta.len().to_string()) + .set("Content-Type", "application/octet-stream") + .send(buffered_reader) { Ok(_) => { log::info!("Database uploaded"); log::info!("Asking plugin to stop mixer");