Skip to content

Commit 7d4c00c

Browse files
edwintoroklindig
authored andcommitted
CA-381119: use JsonRPC V2 for error replies
For regular replies we look at the request and reply with a matching version. However when we fail to parse the JsonRPC request itself then we don't know what version to use. XenCenter uses JsonRPC v2 by default, and JsonRPC v2 has been supported in XAPI for a long time. Signed-off-by: Edwin Török <edwin.torok@cloud.com>
1 parent 2570a99 commit 7d4c00c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ocaml/xapi/api_server.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ let jsoncallback req bio _ =
346346
Http_svr.response_str req
347347
~hdrs:[(Http.Hdr.content_type, "application/json")]
348348
fd
349-
(Jsonrpc.string_of_response
349+
(Jsonrpc.string_of_response ~version:Jsonrpc.V2
350350
(Rpc.failure
351351
(Rpc.Enum (List.map (fun s -> Rpc.String s) (err :: params)))
352352
)

0 commit comments

Comments
 (0)