fix(client): allow empty values as params

pull/273/head
Jef Roosens 2022-09-11 22:20:02 +02:00
parent 39e2d12827
commit 575c04189d
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 2 additions and 4 deletions

View File

@ -30,12 +30,10 @@ fn (c &Client) send_request_raw(method Method, url string, params map[string]str
// Escape each query param
for k, v in params {
// An empty parameter should be the same as not providing it at all
if v != '' {
params_escaped[k] = urllib.query_escape(v)
}
params_escaped[k] = urllib.query_escape(v)
}
params_str := params_escaped.keys().map('$it=${params[it]}').join('&')
params_str := params_escaped.keys().map('$it=${params_escaped[it]}').join('&')
full_url = '$full_url?$params_str'
}