less strict requirements to content-type=application/json (#2392)

This commit is contained in:
Alex Garcia 2024-08-14 21:33:58 -07:00 committed by GitHub
commit cf4274f2a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -364,7 +364,7 @@ class TableInsertView(BaseView):
def _errors(errors):
return None, errors, {}
if request.headers.get("content-type") != "application/json":
if not request.headers.get("content-type").startswith("application/json"):
# TODO: handle form-encoded data
return _errors(["Invalid content-type, must be application/json"])
body = await request.post_body()