mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-21 04:05:51 +00:00
specify [min, default, max] limits in handler table (#135)
* specify rpc limits in the handler table * special case in ledger_data if !binary
This commit is contained in:
@@ -30,10 +30,13 @@ doLedgerData(Context const& context)
|
||||
|
||||
bool const binary = getBool(request, "binary", false);
|
||||
|
||||
std::uint32_t limit = binary ? 2048 : 256;
|
||||
if (auto const status = getLimit(request, limit); status)
|
||||
std::uint32_t limit;
|
||||
if (auto const status = getLimit(context, limit); status)
|
||||
return status;
|
||||
|
||||
if (!binary)
|
||||
limit = std::clamp(limit, {1}, {256});
|
||||
|
||||
bool outOfOrder = false;
|
||||
if (request.contains("out_of_order"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user