|
|
|
|
|
by mvolfik
1869 days ago
|
|
How are these set in werkzeug? Sound like you would be using the werkzeug dev server then... But this works for me: @app.errorhandler(ApplicationError)
def handle(e):
resp = e.args[0]
resp.headers["Access-Control-Allow-Origin"] = "..."
resp.status_code = 500
return resp
@app.route("/err")
def err():
raise ApplicationError(jsonify({"reason": "test"}))
|
|
I was talking about using werkzeug's builtin exception handler but with custom headers - which doesn't appear to be supported.