Skip to content

Commit 451a83a

Browse files
Update challenges.py (CTFd#2564)
* Update challenges.py Hi, i add this to solve a problem i detected when POST to /api/v1/challenges/attempt content-type include charset -> 'content-type: application/json; charset=utf-8'. I hope it helps! * Update challenges.py Modified to use Flask is_json as @ColdHeat suggested in CTFd#2564
1 parent c912b84 commit 451a83a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CTFd/api/v1/challenges.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def post(self):
497497
if authed() is False:
498498
return {"success": True, "data": {"status": "authentication_required"}}, 403
499499

500-
if request.content_type != "application/json":
500+
if not request.is_json:
501501
request_data = request.form
502502
else:
503503
request_data = request.get_json()

0 commit comments

Comments
 (0)