We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a3e0c6 commit a60099aCopy full SHA for a60099a
src/api/main.py
@@ -68,7 +68,7 @@ def _get_src_ip() -> str:
68
# curl -XPOST https://risk.oxl.app/api/report --data '{"ip": "1.1.1.1", "cat": "bot"}' -H 'Content-Type: application/json'
69
@app.route('/api/report', methods=['POST'])
70
def report() -> Response:
71
- if 'Content-Type' not in request.headers or request.headers['Content-Type'] != 'application/json':
+ if 'Content-Type' not in request.headers or not request.headers['Content-Type'].startswith('application/json'):
72
return _response_json(code=400, data={'msg': 'Expected JSON'})
73
74
data = request.get_json()
0 commit comments