-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(zero): fix zero's health endpoint to return json response (#8858)
Fixes #5517 Zero's /health endpoint just returns OK unlike Alpha's JSON output. ## Problem curl http://alpha-hostname:alpha-http-port/health returns a JSON output whereas, curl http://zero-hostname:zero-http-port/health returns a plain text "OK". ## Solution Added code to return a plain text output ("OK") for the "text/plain" to maintain the backward compatibility and return JSON output for "Accept: application/json" header. Example Output: $ curl http://localhost:58696/health OK $ curl -H "Accept: application/json" http://localhost:58696/health {"instance":"zero","address":"zero1:5080","status":"healthy","version":"v23.0.0-16-g90139243f","uptime":9223372036,"lastEcho":1686137664}
- Loading branch information
Showing
2 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters