Compare commits

...

2 Commits

Author SHA1 Message Date
Kevin F 7895442b51 Respond to OPTIONS in rpc 2023-01-04 00:52:15 -06:00
Kevin F 474ef21163 Remove old dispatcher for getting blocks in RPC blocks wrapper 2023-01-02 19:36:37 -06:00
2 changed files with 6 additions and 1 deletions

View File

@ -60,6 +60,12 @@ class OnionrRPC(object):
@cherrypy.expose
def rpc(self):
# Dispatcher is dictionary {<method_name>: callable}
if cherrypy.request.method == 'OPTIONS':
cherrypy.response.headers['Access-Control-Allow-Origin'] = '*'
cherrypy.response.headers['Access-Control-Allow-Methods'] = 'POST'
return ''
data = cherrypy.request.body.read().decode('utf-8')
response = JSONRPCResponseManager.handle(data, dispatcher)

View File

@ -22,4 +22,3 @@ def insert_block(block):
gossip_block_queues[queue_to_use].put_nowait(block)
return "ok"
#dispatcher['get_blocks_after_timestamp'] = get_blocks_after_timestamp