Bug 1152319: calling /rest/logout results in an internal error and a malformed response to the caller

r=glob,a=glob


git-svn-id: svn://10.0.0.236/trunk@265917 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2015-04-10 13:45:51 +00:00
parent 6945ffb3f7
commit 45d24e9f43
3 changed files with 12 additions and 2 deletions

View File

@ -1 +1 @@
9371 9372

View File

@ -1 +1 @@
647b7158953b7db7ebab61f54796669561470351 a6d74986bd7b96aa41624ed407a46f7f63eadd55

View File

@ -89,6 +89,16 @@ sub handle {
# Execute the handler # Execute the handler
my $result = $self->_handle; my $result = $self->_handle;
# The result needs to be a valid JSON data structure
# and not a undefined or scalar value.
if (!ref $result
|| blessed($result)
|| ref $result ne 'HASH'
|| ref $result ne 'ARRAY')
{
$result = { result => $result };
}
$self->response($result); $self->response($result);
} }