fixed bad method status code in syncapi

This commit is contained in:
aliqandil 2025-03-22 10:01:25 +03:30
parent 55173a5b2e
commit f149b19606
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
#
# -- syncapi.py
# Automatically generates urlpatterns from signatures and guards
#
#
##
import logging; logger = logging.getLogger(__name__)
@ -42,7 +42,7 @@ def Endpoint( sig, *guard_args ):
@csrf_exempt
def decorated( request, *args, **kwargs ):
if request.method != method: return HttpResponse("Bad Method", 400)
if request.method != method: return HttpResponse("Bad Method", status = 400)
request.is_json = False
if request.body and request.headers['Content-Type'].startswith('application/json'): #Coule be: application/json; charset=utf-8
@ -102,7 +102,7 @@ def Endpoint( sig, *guard_args ):
try:
decorated = route_to_others[route][request.method]
except KeyError:
return HttpResponse("Bad Method", 400)
return HttpResponse("Bad Method", status = 400)
else:
return decorated( request, *args, **kwargs )

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='asyncron',
version='0.1.9.2',
version='0.1.9.3',
packages=find_packages(),
#include_package_data=True, # Include static files from MANIFEST.in
install_requires=[