From 22d7ca2103f706321e0f23576ae63e1de3d90a44 Mon Sep 17 00:00:00 2001 From: EggPool <33421807+EggPool@users.noreply.github.com> Date: Tue, 20 Aug 2019 12:09:11 +0200 Subject: [PATCH] Soften check for Content-type Some servers do send "application/json; charset=UTF-8" as content-type. This makes the client compatible with them too. --- bitcoinrpc/authproxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoinrpc/authproxy.py b/bitcoinrpc/authproxy.py index abebe4b..3d9eb8c 100644 --- a/bitcoinrpc/authproxy.py +++ b/bitcoinrpc/authproxy.py @@ -188,7 +188,7 @@ def _get_response(self): 'code': -342, 'message': 'missing HTTP response from server'}) content_type = http_response.getheader('Content-Type') - if content_type != 'application/json': + if not content_type.startswith('application/json'): raise JSONRPCException({ 'code': -342, 'message': 'non-JSON HTTP response with \'%i %s\' from server' % (http_response.status, http_response.reason)})