🐛 correction to last commit

This commit is contained in:
EntireTwix 2022-11-21 22:53:28 -08:00
parent 1b2c763f0b
commit 78b62092b3

View file

@ -1,5 +1,7 @@
#include "bank_api.h"
// TODO: parser iterate(input).get(doc) error handling might be superfulous
#define CACHE_FOREVER resp->setExpiredTime(0)
#define CORS resp->addHeader("Access-Control-Allow-Origin", "*")
@ -301,7 +303,7 @@ void api::AdminAddUser(req_args)
std::string_view name;
uint64_t amount;
std::string_view pass;
if (doc["name"].get(name) || doc["amount"].get(amount) || doc["time"].get(pass))
if (doc["name"].get(name) || doc["amount"].get(amount) || doc["time"].get(pass) || (amount > std::numeric_limits<uint32_t>::max()))
{
res = BankResponse{k400BadRequest, "\"Missing/Invalid JSON arg(s)\""};
}