调整目录结构
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# xss过滤
|
||||
from flask import abort, make_response, jsonify
|
||||
|
||||
|
||||
def xss_escape(s: str):
|
||||
if s is None:
|
||||
return None
|
||||
else:
|
||||
return s.replace("&", "&").replace(">", ">").replace("<", "<").replace("'", "'").replace('"',
|
||||
""")
|
||||
|
||||
|
||||
def check_data(schema, data):
|
||||
errors = schema.validate(data)
|
||||
for k, v in errors.items():
|
||||
for i in v:
|
||||
# print("{}{}".format(k, i))
|
||||
msg = "{}{}".format(k, i)
|
||||
if errors:
|
||||
abort(make_response(jsonify(result=False, msg=msg), 200))
|
||||
Reference in New Issue
Block a user