From 45d24e9f4364e888476ed88679da3107f0b0e447 Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Fri, 10 Apr 2015 13:45:51 +0000 Subject: [PATCH] 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 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/.gitrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index b7eac6be47a..b5e4fe3ee2d 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9371 \ No newline at end of file +9372 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index a7445325ade..138c1af1bf3 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -647b7158953b7db7ebab61f54796669561470351 \ No newline at end of file +a6d74986bd7b96aa41624ed407a46f7f63eadd55 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm b/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm index ed147dc2a35..6136440cf2f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/API/1_0/Server.pm +++ b/mozilla/webtools/bugzilla/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); }