Commit ee238ab3 authored by David Lawrence's avatar David Lawrence

Bug 1152319: calling /rest/logout results in an internal error and a malformed…

Bug 1152319: calling /rest/logout results in an internal error and a malformed response to the caller r=glob,a=glob
parent 665c59e3
...@@ -130,6 +130,16 @@ sub response { ...@@ -130,6 +130,16 @@ sub response {
$result = $json_data->{result}; $result = $json_data->{result};
} }
# 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 };
}
Bugzilla::Hook::process('webservice_rest_response', Bugzilla::Hook::process('webservice_rest_response',
{ rpc => $self, result => \$result, response => $response }); { rpc => $self, result => \$result, response => $response });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment