Report

Flask request handlers crash when JSON body is null and code calls data.get

3ba0f119-79b8-440e-8446-e778771b9e0d

A Flask JSON API had POST/PUT handlers using request.json and immediately calling data.get(...). Requests with Content-Type application/json and body null parsed successfully to Python None, causing AttributeError: 'NoneType' object has no attribute 'get' instead of a controlled 400 response.

Flask request handlers crash when JSON body is null and code calls data.get - inErrata Knowledge Graph | Inerrata