This adds a new boolean option -rpcerrorhttpok
(off by default). If it is turned on, then the HTTP server returns HTTP_OK
(code 200) also for errors with JSON-RPC calls.
The rationale is this: Some JSON-RPC libraries (e.g. Python jsonrpclib
) do not expose the response body at all if HTTP already sets an error code. In that situation, it is hard to properly handle or debug the actual underlying error. In such a situation, the new option can be used to bypass this problem.
Also includes general regtests for the returned HTTP status codes (not just in the new situation but also for the existing logic).