From: David Lawrence Date: Fri, 10 Apr 2015 13:25:26 +0000 (+0100) Subject: Bug 1152319: calling /rest/logout results in an internal error and a malformed respon... X-Git-Tag: release-5.1.1~293 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6d74986bd7b96aa41624ed407a46f7f63eadd55;p=thirdparty%2Fbugzilla.git Bug 1152319: calling /rest/logout results in an internal error and a malformed response to the caller r=glob,a=glob --- diff --git a/Bugzilla/API/1_0/Server.pm b/Bugzilla/API/1_0/Server.pm index ed147dc2a3..6136440cf2 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); }