-
Notifications
You must be signed in to change notification settings - Fork 172
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
fix(http server): omit jsonrpc details in health API #785
Conversation
Closing #784 Ordinary GET requests doesn't expect the body the be formatted as `JSON-RPC` responses which this fixes.
if !path.starts_with("/") { | ||
return Err(Error::Custom(format!("Health endpoint path must start with `/` to work, got: {}", path))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering; why do we care about the path starting with '/'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we have this check, if /
is missing that will fail and it's quite tricky to debug.
I have already done that myself but more ideally would be Path type
instead of a String
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok gotcha; that makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a suggestion on plucking the result out without the intermediate Value stuff :)
Closing #784
Ordinary HTTP GET requests doesn't expect the body the be formatted as
JSON-RPC
responses which this fixes i.e, just regular JSON.