mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 00:09:40 +02:00
fix(api): fix an issue with optional numeric query parameter parsing
This commit is contained in:
parent
4129550d44
commit
509e3fa795
2 changed files with 5 additions and 0 deletions
|
@ -133,6 +133,9 @@ func RetrieveNumericQueryParameter(request *http.Request, name string, optional
|
|||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if queryParameter == "" && optional {
|
||||
return 0, nil
|
||||
}
|
||||
return strconv.Atoi(queryParameter)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue