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

Return status code 200 for JSONRPC errors in the factomd api #897

Conversation

WhoSoup
Copy link
Member

@WhoSoup WhoSoup commented Oct 16, 2019

closes: #893

This is an inconsistency of the jsonrpc spec. the tl;dr is that all responses with valid jsonrpc formatting should receive a status code of 200, including jsonrpc errors. At the moment, the factom client does not actually check the status code of responses at all.

This may have unintended side effects if there are libraries out there that wrongly depend on the http status code to detect if a json response is an error or not.

This PR replaces all Status code 400 responses with status code 200 and updates the V1 unit test to check for an RPC error instead of the status code.

@stackdump stackdump changed the base branch from master to FD-1112_a4_rollup October 18, 2019 14:08
@stackdump stackdump changed the base branch from FD-1112_a4_rollup to FD-1224_set_200_status_on_rpc_errors October 21, 2019 13:36
@stackdump stackdump merged commit 8b591a0 into FactomProject:FD-1224_set_200_status_on_rpc_errors Oct 21, 2019
@WhoSoup WhoSoup mentioned this pull request Feb 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants