Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[http server]: health_api uses the entire jsonrpc response in the body #784

Closed
niklasad1 opened this issue May 26, 2022 · 1 comment
Closed

Comments

@niklasad1
Copy link
Member

curl http://mydomaini:9933/health
{"jsonrpc":"2.0","result":{"peers":28,"isSyncing":false,"shouldHavePeers":true},"id":0}

As this is only a pure HTTP get request it would be more accurate to just return the result and exclude the jsonrpc related stuff.
In other words the following would be better:

{"peers":28,"isSyncing":false,"shouldHavePeers":true}
niklasad1 added a commit that referenced this issue May 26, 2022
Closing #784
Ordinary GET requests doesn't expect the body the be formatted as
`JSON-RPC` responses which this fixes.
niklasad1 added a commit that referenced this issue Jun 1, 2022
* fix(http server): omit jsonrpc details health API

Closing #784
Ordinary GET requests doesn't expect the body the be formatted as
`JSON-RPC` responses which this fixes.

* address grumbles

* Update http-server/src/server.rs

* cargo fmt
@niklasad1
Copy link
Member Author

Closed by #785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant