mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
405 method not allowed for GET to POST endpoints, closes #1916
This commit is contained in:
parent
5518397338
commit
8404b21556
2 changed files with 26 additions and 1 deletions
|
|
@ -69,7 +69,6 @@ class BaseView:
|
|||
return "ff0000"
|
||||
|
||||
async def method_not_allowed(self, request):
|
||||
print(request.headers)
|
||||
if (
|
||||
request.path.endswith(".json")
|
||||
or request.headers.get("content-type") == "application/json"
|
||||
|
|
@ -82,6 +81,9 @@ class BaseView:
|
|||
async def options(self, request, *args, **kwargs):
|
||||
return await self.method_not_allowed(request)
|
||||
|
||||
async def get(self, request, *args, **kwargs):
|
||||
return await self.method_not_allowed(request)
|
||||
|
||||
async def post(self, request, *args, **kwargs):
|
||||
return await self.method_not_allowed(request)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue