Fix RPC plugin server binding incorrectly to TCP and doubling up JSON encoding

This commit is contained in:
Kevin F 2022-12-02 21:40:33 +00:00
parent 180116a55d
commit 446662cc60

View File

@ -58,7 +58,6 @@ plugin_apis['rpc.add_module_to_api'] = add_module_to_api
class OnionrRPC(object):
@cherrypy.expose
@cherrypy.tools.json_out()
def rpc(self):
# Dispatcher is dictionary {<method_name>: callable}
data = cherrypy.request.body.read().decode('utf-8')
@ -75,7 +74,7 @@ def rpc_client(*args, **kwargs):
*args, **kwargs)
else:
return requests.post(
f'http://{config.get("rpc.bind_host")}/rpc:{config.get("rpc.bind_port")}',
f'http://{config.get("rpc.bind_host")}:{config.get("rpc.bind_port")}/rpc',
*args, **kwargs)
def on_beforecmdparsing(api, data=None):