Commit 16a062c1 authored by Jordan Petridis's avatar Jordan Petridis

build: do not append params if they don't exist.

parent c4f69d6f
......@@ -950,10 +950,13 @@ pub fn build_url(base: &Url, path: &str, params: Vec<(&str, String)>) -> Result<
let mut url = base.join(path)?;
{
let mut query = url.query_pairs_mut();
query.clear();
for (k, v) in params {
query.append_pair(k, &v);
// If len was 0 `?` would be appended without being needed.
if params.len() >= 1 {
let mut query = url.query_pairs_mut();
query.clear();
for (k, v) in params {
query.append_pair(k, &v);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment