Skip to content
New issue

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

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

Already on GitHub? # to your account

JSON/RPC endpoint returns HTTP status 500 on error (should be 200) #1387

Closed
saurik opened this issue Dec 7, 2020 · 2 comments
Closed

JSON/RPC endpoint returns HTTP status 500 on error (should be 200) #1387

saurik opened this issue Dec 7, 2020 · 2 comments

Comments

@saurik
Copy link

saurik commented Dec 7, 2020

When JSON/RPC endpoints return errors, the resulting body JSON document contains the error message and the HTTP status is supposed to be 200. While I personally can see an argument for why JSON/RPC "should have" returned an HTTP error in this case, it actually doesn't make much sense in other contexts and no matter what 500 would be the wrong code to return.

# curl -w '%{http_code}\n' -o/dev/null -s -H 'content-type: application/json' --data '{"id":"","jsonrpc":"2.0","method":"eth_chainId","params":[2]}' https://public-node.testnet.rsk.co/
500
# curl -L --post301 -w '%{http_code}\n' -o/dev/null -s -H 'content-type: application/json' --data '{"id":"","jsonrpc":"2.0","method":"eth_chainId","params":[2]}' https://ethereumclassic.network/
200
@patogallaiovlabs
Copy link
Contributor

I'll take a look... make sense what you say, the node behaves like v1.0 spec, for v2.0 all the codes shouldn't be necessary. We can follow sthg like this: hyperledger/besu#549

@bguiz
Copy link

bguiz commented Apr 29, 2021

can we get this addressed in the next release pls?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants