Skip to content

Commit

Permalink
CA-381119: use JsonRPC V2 for error replies
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
edwintorok authored and lindig committed Jun 26, 2024
1 parent 2570a99 commit 7d4c00c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocaml/xapi/api_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ let jsoncallback req bio _ =
Http_svr.response_str req
~hdrs:[(Http.Hdr.content_type, "application/json")]
fd
(Jsonrpc.string_of_response
(Jsonrpc.string_of_response ~version:Jsonrpc.V2
(Rpc.failure
(Rpc.Enum (List.map (fun s -> Rpc.String s) (err :: params)))
)
Expand Down

0 comments on commit 7d4c00c

Please sign in to comment.