Skip to content

Commit 114cb0d

Browse files
committed
Fix query parameter passing
1 parent 4ce5d56 commit 114cb0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/client.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@ impl Client {
218218

219219
if let Some(query) = endpoint.query() {
220220
let query_string = serde_qs::to_string(&query).expect("serialize the query correctly");
221-
url.push_str(&query_string);
221+
if !query_string.is_empty() {
222+
if !url.ends_with('?') {
223+
url.push('?');
224+
}
225+
url.push_str(&query_string);
226+
}
222227
}
223228

224229
let mut request = self.client.request(endpoint.method(), url);

0 commit comments

Comments
 (0)