Compare commits
2 Commits
8e35a79864
...
7895442b51
Author | SHA1 | Date | |
---|---|---|---|
|
7895442b51 | ||
|
474ef21163 |
@ -60,6 +60,12 @@ class OnionrRPC(object):
|
|||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def rpc(self):
|
def rpc(self):
|
||||||
# Dispatcher is dictionary {<method_name>: callable}
|
# 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')
|
data = cherrypy.request.body.read().decode('utf-8')
|
||||||
|
|
||||||
response = JSONRPCResponseManager.handle(data, dispatcher)
|
response = JSONRPCResponseManager.handle(data, dispatcher)
|
||||||
|
@ -22,4 +22,3 @@ def insert_block(block):
|
|||||||
gossip_block_queues[queue_to_use].put_nowait(block)
|
gossip_block_queues[queue_to_use].put_nowait(block)
|
||||||
return "ok"
|
return "ok"
|
||||||
|
|
||||||
#dispatcher['get_blocks_after_timestamp'] = get_blocks_after_timestamp
|
|
||||||
|
Loading…
Reference in New Issue
Block a user