src/client/http_client.rs: trim path

This commit is contained in:
Dietmar Maurer 2019-02-18 06:24:28 +01:00
parent 7f1685230a
commit 591f570b22

View File

@ -79,6 +79,7 @@ impl HttpClient {
pub fn get(&self, path: &str) -> Result<Value, Error> {
let path = path.trim_matches('/');
let url: Uri = format!("https://{}:8007/{}", self.server, path).parse()?;
let ticket = self.login()?;
@ -128,6 +129,7 @@ impl HttpClient {
pub fn upload(&self, content_type: &str, body: Body, path: &str) -> Result<Value, Error> {
let path = path.trim_matches('/');
let url: Uri = format!("https://{}:8007/{}", self.server, path).parse()?;
let ticket = self.login()?;