The /readiness health check endpoint does not validate that the minPeers and maxBlocksBehind query parameters are non-negative integers. Negative values are silently accepted, producing semantically incorrect health responses:
minPeers=-N → always reports healthy (even with 0 peers)
maxBlocksBehind=-N → always reports unhealthy (even when fully synced)
Expected Behaviour
Negative values should be rejected with an appropriate error message in the diagnostic response, consistent with how NumberFormatException is already handled for non-numeric inputs.
Acceptance Criteria
minPeers rejects negative values and reports peersOk = false with error detail
maxBlocksBehind rejects negative values and reports syncOk = false with error detail
- Unit tests cover both negative value cases
The
/readinesshealth check endpoint does not validate that theminPeersandmaxBlocksBehindquery parameters are non-negative integers. Negative values are silently accepted, producing semantically incorrect health responses:minPeers=-N→ always reports healthy (even with 0 peers)maxBlocksBehind=-N→ always reports unhealthy (even when fully synced)Expected Behaviour
Negative values should be rejected with an appropriate error message in the diagnostic response, consistent with how
NumberFormatExceptionis already handled for non-numeric inputs.Acceptance Criteria
minPeersrejects negative values and reportspeersOk = falsewith error detailmaxBlocksBehindrejects negative values and reportssyncOk = falsewith error detail