diff options
author | David Lawrence <dkl@mozilla.com> | 2015-04-10 15:25:26 +0200 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2015-04-10 15:25:26 +0200 |
commit | a6d74986bd7b96aa41624ed407a46f7f63eadd55 (patch) | |
tree | 2f80620b59e57414d49ab56194af4e98d180117a | |
parent | 647b7158953b7db7ebab61f54796669561470351 (diff) | |
download | bugzilla-a6d74986bd7b96aa41624ed407a46f7f63eadd55.tar.gz bugzilla-a6d74986bd7b96aa41624ed407a46f7f63eadd55.tar.xz |
Bug 1152319: calling /rest/logout results in an internal error and a malformed response to the caller
r=glob,a=glob
-rw-r--r-- | Bugzilla/API/1_0/Server.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Bugzilla/API/1_0/Server.pm b/Bugzilla/API/1_0/Server.pm index ed147dc2a..6136440cf 100644 --- a/Bugzilla/API/1_0/Server.pm +++ b/Bugzilla/API/1_0/Server.pm @@ -89,6 +89,16 @@ sub handle { # Execute the handler 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); } |