Merge pull request #60 from bertoncelj1/cors
Add a header for CORS support
This commit is contained in:
commit
cee92290ba
@ -217,7 +217,8 @@ class AjaxServer:
|
|||||||
def resetHeaders(self):
|
def resetHeaders(self):
|
||||||
self.headers = [
|
self.headers = [
|
||||||
['HTTP/1.1 200 OK', None],
|
['HTTP/1.1 200 OK', None],
|
||||||
['Content-Type', 'text/json']
|
['Content-Type', 'text/json'],
|
||||||
|
['Access-Control-Allow-Origin', '*']
|
||||||
]
|
]
|
||||||
self.extraHeaders = {}
|
self.extraHeaders = {}
|
||||||
|
|
||||||
@ -268,7 +269,7 @@ class AjaxServer:
|
|||||||
params = json.loads(makeStr(req.body))
|
params = json.loads(makeStr(req.body))
|
||||||
body = makeBytes(json.dumps(self.handler(params)))
|
body = makeBytes(json.dumps(self.handler(params)))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
body = json.dumps(None);
|
body = makeBytes(json.dumps(None))
|
||||||
|
|
||||||
resp = bytes()
|
resp = bytes()
|
||||||
|
|
||||||
@ -785,7 +786,8 @@ class AnkiBridge:
|
|||||||
'answer': card._getQA()['a'],
|
'answer': card._getQA()['a'],
|
||||||
'buttons': [b[0] for b in reviewer._answerButtonList()],
|
'buttons': [b[0] for b in reviewer._answerButtonList()],
|
||||||
'modelName': model['name'],
|
'modelName': model['name'],
|
||||||
'deckName': self.deckNameFromId(card.did)
|
'deckName': self.deckNameFromId(card.did),
|
||||||
|
'css': model['css']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user