Skip to content

Commit

Permalink
Fixed a crash upon trying to use query param with no value
Browse files Browse the repository at this point in the history
  • Loading branch information
zneix authored and lleadbet committed Jul 16, 2021
1 parent f33a73d commit cbefd55
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ func NewRequest(method string, path string, queryParameters []string, body []byt
}

q := u.Query()
for _, param := range queryParameters {
value := strings.Split(param, "=")
q.Add(value[0], value[1])
for _, paramStr := range queryParameters {
var value string
param := strings.Split(paramStr, "=")
if len(param) == 2 {
value = param[1]
}
q.Add(param[0], value)
}

if cursor != "" {
Expand Down

0 comments on commit cbefd55

Please sign in to comment.