Skip to content

Commit

Permalink
less strict requirements to content-type=application/json (#2392)
Browse files Browse the repository at this point in the history
  • Loading branch information
asg017 authored Aug 15, 2024
1 parent e9d34a9 commit cf4274f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasette/views/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ async def _validate_data(self, request, db, table_name, pks, upsert):
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()
Expand Down

0 comments on commit cf4274f

Please sign in to comment.