From cf4274f2a3a0e6cddfdd7fe03f526cf9fe8b21a4 Mon Sep 17 00:00:00 2001 From: Alex Garcia Date: Wed, 14 Aug 2024 21:33:58 -0700 Subject: [PATCH] less strict requirements to content-type=application/json (#2392) --- 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 fa2c80de..ba0dd4f3 100644 --- a/datasette/views/table.py +++ b/datasette/views/table.py @@ -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()