]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1152319: calling /rest/logout results in an internal error and a malformed respon...
authorDavid Lawrence <dkl@mozilla.com>
Fri, 10 Apr 2015 13:25:26 +0000 (14:25 +0100)
committerDavid Lawrence <dkl@mozilla.com>
Fri, 10 Apr 2015 13:25:26 +0000 (14:25 +0100)
r=glob,a=glob

Bugzilla/API/1_0/Server.pm

index ed147dc2a3553d0f7d24a168f9ccc2882c6b6d93..6136440cf2f561b7d5107eda9c671c44d5b52f58 100644 (file)
@@ -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);
 }