fix jsonrpc http headers

This commit is contained in:
Alex Grintsvayg 2017-03-13 11:54:40 -04:00
parent 003b3df378
commit 92d423aefd

View file

@ -114,7 +114,8 @@ class AuthJSONRPCServer(AuthorizedBase):
def _set_headers(self, request, data, update_secret=False): def _set_headers(self, request, data, update_secret=False):
if conf.settings['allowed_origin']: if conf.settings['allowed_origin']:
request.setHeader("Access-Control-Allow-Origin", conf.settings['allowed_origin']) request.setHeader("Access-Control-Allow-Origin", conf.settings['allowed_origin'])
request.setHeader("Content-Type", "text/json") request.setHeader("Content-Type", "application/json")
request.setHeader("Accept", "application/json-rpc")
request.setHeader("Content-Length", str(len(data))) request.setHeader("Content-Length", str(len(data)))
if update_secret: if update_secret:
session_id = request.getSession().uid session_id = request.getSession().uid