

def jsonify(data):
    "Returns a flask.Response of data, JSON-stringified.\n\n    This is basically Flask's jsonify\n    (https://github.com/mitsuhiko/flask/blob/master/flask/json.py), but plugs\n    an XSS hole.\n    "
    indent = (None if flask.request.is_xhr else 2)
    jsonified = json.dumps(data, indent=indent)
    jsonified_safe = jsonified.replace('</', '<\\/')
    return flask.current_app.response_class(jsonified_safe, mimetype='application/json')

dataset/ETHPy150Open vim-awesome/vim-awesome/web/api/api_util.py jsonify/original