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