Fix empty status string handling, address #6175. (#6391)

This commit is contained in:
Eugene Kabanov 2024-06-28 06:54:51 +03:00 committed by GitHub
parent bab7d8428f
commit 190dbfd481
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -425,7 +425,11 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
Http400, InvalidRequestBodyError, $error) Http400, InvalidRequestBodyError, $error)
let let
ids = request.ids.valueOr: @[] ids = request.ids.valueOr: @[]
filter = request.status.valueOr: AllValidatorFilterKinds filter =
if request.status.isNone() or len(request.status.get) == 0:
AllValidatorFilterKinds
else:
request.status.get
(ids, filter) (ids, filter)
sid = state_id.valueOr: sid = state_id.valueOr:
return RestApiResponse.jsonError(Http400, InvalidStateIdValueError, return RestApiResponse.jsonError(Http400, InvalidStateIdValueError,