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

@ -42,7 +42,7 @@ def Endpoint( sig, *guard_args ):
@csrf_exempt @csrf_exempt
def decorated( request, *args, **kwargs ): 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 request.is_json = False
if request.body and request.headers['Content-Type'].startswith('application/json'): #Coule be: application/json; charset=utf-8 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: try:
decorated = route_to_others[route][request.method] decorated = route_to_others[route][request.method]
except KeyError: except KeyError:
return HttpResponse("Bad Method", 400) return HttpResponse("Bad Method", status = 400)
else: else:
return decorated( request, *args, **kwargs ) return decorated( request, *args, **kwargs )

View File

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