summaryrefslogtreecommitdiff
path: root/jsonrpclib/SimpleJSONRPCServer.py
diff options
context:
space:
mode:
authorPaul Smith <prs247au@gmail.com>2017-06-28 14:17:59 +1000
committerPaul Smith <prs247au@gmail.com>2017-06-28 14:17:59 +1000
commitee90663dde0e46927d11d049f9a516e5381b0d0f (patch)
treec5b8205303f473bf5178ec511f32375bdae77087 /jsonrpclib/SimpleJSONRPCServer.py
parent20e55bb1ffbce03885745d4ad7de775d79d3338a (diff)
downloadjsonrpclib-ee90663dde0e46927d11d049f9a516e5381b0d0f.tar.gz
Remove HTTP class and use HTTPConnection instead. Fixes bug for Python 3.x on linux.
Diffstat (limited to 'jsonrpclib/SimpleJSONRPCServer.py')
-rw-r--r--jsonrpclib/SimpleJSONRPCServer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/jsonrpclib/SimpleJSONRPCServer.py b/jsonrpclib/SimpleJSONRPCServer.py
index 290fafa..708c5d2 100644
--- a/jsonrpclib/SimpleJSONRPCServer.py
+++ b/jsonrpclib/SimpleJSONRPCServer.py
@@ -187,7 +187,10 @@ class SimpleJSONRPCRequestHandler(
self.send_header("Content-type", "application/json-rpc")
self.send_header("Content-length", str(len(response)))
self.end_headers()
- self.wfile.write(response.encode())
+ if isinstance(response, bytes):
+ self.wfile.write(response)
+ else:
+ self.wfile.write(response.encode())
self.wfile.flush()
self.connection.shutdown(1)