make sure URI paths start with a slash
Otherwise we get an empty error message. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3e234af16e
commit
c4e1af3069
@ -277,15 +277,15 @@ fn load_ticket_info(prefix: &str, server: &str, userid: &Userid) -> Option<(Stri
|
||||
}
|
||||
|
||||
fn build_uri(server: &str, port: u16, path: &str, query: Option<String>) -> Result<Uri, Error> {
|
||||
let builder = Uri::builder()
|
||||
Uri::builder()
|
||||
.scheme("https")
|
||||
.authority(build_authority(server, port)?);
|
||||
match query {
|
||||
Some(query) => builder.path_and_query(format!("{}?{}", path, query)),
|
||||
None => builder.path_and_query(path),
|
||||
}
|
||||
.authority(build_authority(server, port)?)
|
||||
.path_and_query(match query {
|
||||
Some(query) => format!("/{}?{}", path, query),
|
||||
None => format!("/{}", path),
|
||||
})
|
||||
.build()
|
||||
.map_err(Error::from)
|
||||
.map_err(|err| format_err!("error building uri - {}", err))
|
||||
}
|
||||
|
||||
impl HttpClient {
|
||||
|
Loading…
Reference in New Issue
Block a user