_method ended up as an argument when it was an empty string

This commit is contained in:
Alessandro Molina 2016-02-10 00:00:58 +01:00
parent 953f5ed119
commit 3699ab0cab
1 changed files with 1 additions and 2 deletions

View File

@ -210,7 +210,7 @@ class RestDispatcher(ObjectDispatcher):
params = state.params
#conventional hack for handling methods which are not supported by most browsers
request_method = params.get('_method', None)
request_method = params.pop('_method', None)
if request_method:
request_method = request_method.lower()
#make certain that DELETE and PUT requests are not sent with GET
@ -219,7 +219,6 @@ class RestDispatcher(ObjectDispatcher):
if method == 'get' and request_method == 'delete':
raise HTTPMethodNotAllowed
method = request_method
del state.params['_method']
state.http_method = method
r = self._check_for_sub_controllers(state, remainder)