Skip to content

Commit

Permalink
client/v2: encode max_age parameter
Browse files Browse the repository at this point in the history
This parameter was previously ignored if a client passed it in.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
  • Loading branch information
stevekuznetsov committed Apr 2, 2022
1 parent dca17e6 commit 795946d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func (c *Client) Stats(name string, request *v2.RequestOptions) (map[string]v2.C
"count": []string{strconv.Itoa(request.Count)},
"recursive": []string{strconv.FormatBool(request.Recursive)},
}
if request.MaxAge != nil {
data.Set("max_age", request.MaxAge.String())
}

u = fmt.Sprintf("%s?%s", u, data.Encode())
if err := c.httpGetJSONData(&ret, nil, u, "stats"); err != nil {
Expand Down

0 comments on commit 795946d

Please sign in to comment.