sanic compliance
This commit is contained in:
parent
2cbd4e96b8
commit
feff70415f
@ -64,7 +64,7 @@ def get_comments_count(request):
|
|||||||
def new_comment(request):
|
def new_comment(request):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = request.get_json()
|
data = request.json
|
||||||
logger.info(data)
|
logger.info(data)
|
||||||
|
|
||||||
# validate token: retrieve site entity
|
# validate token: retrieve site entity
|
||||||
|
|||||||
@ -20,6 +20,6 @@ def new_mail(request):
|
|||||||
|
|
||||||
except:
|
except:
|
||||||
logger.exception("new mail failure")
|
logger.exception("new mail failure")
|
||||||
abort(400)
|
return response.text('BAD_REQUEST', status=400)
|
||||||
|
|
||||||
return "OK"
|
return response.text('OK')
|
||||||
|
|||||||
@ -59,7 +59,7 @@ processor.start(template_path)
|
|||||||
logger.info("Start Stacosys application")
|
logger.info("Start Stacosys application")
|
||||||
|
|
||||||
# enable CORS
|
# enable CORS
|
||||||
cors = CORS(app, resources={r"/comments/*": {"origins": "*"}})
|
cors = CORS(app, resources={r"/comments/*": {"origins": config.CORS_ORIGIN}})
|
||||||
|
|
||||||
# tune logging level
|
# tune logging level
|
||||||
if not config.DEBUG:
|
if not config.DEBUG:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user