Permalink
Browse files

Merge #7833: tests: Check Content-Type header returned from RPC server

5078ca4 tests: Check Content-Type header returned from RPC server (Wladimir J. van der Laan)
  • Loading branch information...
laanwj committed Apr 18, 2016
2 parents ec870e1 + 5078ca4 commit b1bf511af693c8ad676c0472633c22aed7b733f2
Showing with 5 additions and 0 deletions.
  1. +5 −0 qa/rpc-tests/test_framework/authproxy.py
@@ -154,6 +154,11 @@ def _get_response(self):
raise JSONRPCException({
'code': -342, 'message': 'missing HTTP response from server'})
content_type = http_response.getheader('Content-Type')
if content_type != 'application/json':
raise JSONRPCException({
'code': -342, 'message': 'non-JSON HTTP response with \'%i %s\' from server' % (http_response.status, http_response.reason)})
responsedata = http_response.read().decode('utf8')
response = json.loads(responsedata, parse_float=decimal.Decimal)
if "error" in response and response["error"] is None:

0 comments on commit b1bf511

Please sign in to comment.