From 1287a20b13f43e000588387917a6d4885f0e8416 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Fri, 28 Jan 2022 13:46:48 +0200 Subject: [PATCH] Use HTTP status codes instead of status in body. --- beacon_chain/rpc/rest_node_api.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_chain/rpc/rest_node_api.nim b/beacon_chain/rpc/rest_node_api.nim index f84806117..cbdead554 100644 --- a/beacon_chain/rpc/rest_node_api.nim +++ b/beacon_chain/rpc/rest_node_api.nim @@ -260,12 +260,12 @@ proc installNodeApiHandlers*(router: var RestRouter, node: BeaconNode) = router.api(MethodGet, "/eth/v1/node/health") do () -> RestApiResponse: # TODO: Add ability to detect node's issues and return 503 error according # to specification. - let res = + let status = if node.syncManager.inProgress: - (health: 206) + Http206 else: - (health: 200) - return RestApiResponse.jsonResponse(res) + Http200 + return RestApiResponse.response("", status, contentType = "") # Legacy URLS - Nimbus <= 1.5.5 used to expose the REST API with an additional # `/api` path component