mod_http_api: When using API version>0, avoid result names for integers and strings

This commit is contained in:
Badlop 2023-11-28 13:13:42 +01:00
parent 8671bf70ab
commit d570870be5
1 changed files with 9 additions and 1 deletions

View File

@ -412,7 +412,15 @@ format_command_result(Cmd, Auth, Result, Version) ->
{_, T} = format_result(Result, ResultFormat),
{200, T};
_ ->
{200, {[format_result(Result, ResultFormat)]}}
OtherResult1 = format_result(Result, ResultFormat),
OtherResult2 = case Version of
0 ->
{[OtherResult1]};
_ ->
{_, Other3} = OtherResult1,
Other3
end,
{200, OtherResult2}
end.
format_result(Atom, {Name, atom}) ->