You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Am coming here via an audit of cosmos-sdk. The code for WriteRPCResponseArrayHTTP seems untested but also adds surface area, and duplicates a bunch of code unnecessarily, if kept perhaps could use an improved name like WriteRPCResponsesHTTP, as array is fallacious here (sorry for the nit picking)
If the serve returns without error, a 200 is implicit.
The text was updated successfully, but these errors were encountered:
odeke-em
changed the title
server: WriteRPCResponseArrayHTTP is unnecessaryuntested and could be folded into a variadic variant of WriteRPCResponseHTTP
server: WriteRPCResponseArrayHTTP is untested and could be folded into a variadic variant of WriteRPCResponseHTTP
Jul 18, 2020
Am coming here via an audit of cosmos-sdk. The code for WriteRPCResponseArrayHTTP seems untested but also adds surface area, and duplicates a bunch of code unnecessarily, if kept perhaps could use an improved name like WriteRPCResponsesHTTP, as array is fallacious here (sorry for the nit picking)
tendermint/rpc/jsonrpc/server/http_server.go
Lines 109 to 119 in 5223cba
tendermint/rpc/jsonrpc/server/http_server.go
Lines 124 to 139 in 5223cba
but could really be folded into a variadic version of WriteRPCResponseHTTP whereby if len(res) == 1, proceed normal, lest JSON indent.
If the serve returns without error, a 200 is implicit.
The text was updated successfully, but these errors were encountered: