fixed bad method status code in syncapi
This commit is contained in:
@@ -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 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user