From 3f9b4a7a979cd26c0f9bc19881d15ccbdb707c42 Mon Sep 17 00:00:00 2001 From: Alex Garcia Date: Wed, 14 Aug 2024 15:42:32 -0700 Subject: [PATCH] less strict requirements to content-type=application/json --- datasette/views/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasette/views/table.py b/datasette/views/table.py index fa2c80deae..ba0dd4f34e 100644 --- a/datasette/views/table.py +++ b/datasette/views/table.py @@ -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()