mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
28 lines
620 B
Python
28 lines
620 B
Python
from flask import Flask, request
|
|
from flask_mongoengine import MongoEngine
|
|
from mongosanitizer.sanitizer import sanitize
|
|
import json
|
|
|
|
app = Flask(__name__)
|
|
app.config.from_pyfile('the-config.cfg')
|
|
db = MongoEngine(app)
|
|
|
|
|
|
class Movie(db.Document):
|
|
title = db.StringField(required=True)
|
|
|
|
|
|
Movie(title='test').save()
|
|
|
|
|
|
@app.route("/subclass_objects")
|
|
def subclass_objects():
|
|
unsafe_search = request.args['search']
|
|
json_search = json.loads(unsafe_search)
|
|
safe_search = sanitize(json_search)
|
|
|
|
return Movie.objects(__raw__=safe_search) #$ result=OK
|
|
|
|
# if __name__ == "__main__":
|
|
# app.run(debug=True)
|