Skip to content

Commit a60099a

Browse files
committed
update api content-type check
1 parent 8a3e0c6 commit a60099a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _get_src_ip() -> str:
6868
# curl -XPOST https://risk.oxl.app/api/report --data '{"ip": "1.1.1.1", "cat": "bot"}' -H 'Content-Type: application/json'
6969
@app.route('/api/report', methods=['POST'])
7070
def report() -> Response:
71-
if 'Content-Type' not in request.headers or request.headers['Content-Type'] != 'application/json':
71+
if 'Content-Type' not in request.headers or not request.headers['Content-Type'].startswith('application/json'):
7272
return _response_json(code=400, data={'msg': 'Expected JSON'})
7373

7474
data = request.get_json()

0 commit comments

Comments
 (0)