mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-20 02:08:12 +00:00
Use HTTP status codes instead of status in body.
This commit is contained in:
parent
e264276b36
commit
1287a20b13
@ -260,12 +260,12 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||||||
router.api(MethodGet, "/eth/v1/node/health") do () -> RestApiResponse:
|
router.api(MethodGet, "/eth/v1/node/health") do () -> RestApiResponse:
|
||||||
# TODO: Add ability to detect node's issues and return 503 error according
|
# TODO: Add ability to detect node's issues and return 503 error according
|
||||||
# to specification.
|
# to specification.
|
||||||
let res =
|
let status =
|
||||||
if node.syncManager.inProgress:
|
if node.syncManager.inProgress:
|
||||||
(health: 206)
|
Http206
|
||||||
else:
|
else:
|
||||||
(health: 200)
|
Http200
|
||||||
return RestApiResponse.jsonResponse(res)
|
return RestApiResponse.response("", status, contentType = "")
|
||||||
|
|
||||||
# Legacy URLS - Nimbus <= 1.5.5 used to expose the REST API with an additional
|
# Legacy URLS - Nimbus <= 1.5.5 used to expose the REST API with an additional
|
||||||
# `/api` path component
|
# `/api` path component
|
||||||
|
Loading…
x
Reference in New Issue
Block a user