aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorNiklas Gögge <n.goeggi@gmail.com>2021-12-22 20:47:53 +0100
committerNiklas Gögge <n.goeggi@gmail.com>2021-12-22 20:47:53 +0100
commit064abd14a55e0fa1bff530237816a748d01e0ddb (patch)
tree66494b42b3ef8f8f411d45026ce6b068543381b0 /src/rest.cpp
parent83b8f3a8961baa34a136ecfaf62c3ea0d133b6d6 (diff)
downloadbitcoin-064abd14a55e0fa1bff530237816a748d01e0ddb.tar.xz
[rest] add a more verbose error message for invalid header counts
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index 65033c6c96..eb661c94c6 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -195,7 +195,7 @@ static bool rest_headers(const std::any& context,
const auto parsed_count{ToIntegral<size_t>(path[0])};
if (!parsed_count.has_value() || *parsed_count < 1 || *parsed_count > MAX_REST_HEADERS_RESULTS) {
- return RESTERR(req, HTTP_BAD_REQUEST, strprintf("Header count out of acceptable range (1-%u): %s", MAX_REST_HEADERS_RESULTS, path[0]));
+ return RESTERR(req, HTTP_BAD_REQUEST, strprintf("Header count is invalid or out of acceptable range (1-%u): %s", MAX_REST_HEADERS_RESULTS, path[0]));
}
std::string hashStr = path[1];
@@ -371,7 +371,7 @@ static bool rest_filter_header(const std::any& context, HTTPRequest* req, const
const auto parsed_count{ToIntegral<size_t>(uri_parts[1])};
if (!parsed_count.has_value() || *parsed_count < 1 || *parsed_count > MAX_REST_HEADERS_RESULTS) {
- return RESTERR(req, HTTP_BAD_REQUEST, strprintf("Header count out of acceptable range (1-%u): %s", MAX_REST_HEADERS_RESULTS, uri_parts[1]));
+ return RESTERR(req, HTTP_BAD_REQUEST, strprintf("Header count is invalid or out of acceptable range (1-%u): %s", MAX_REST_HEADERS_RESULTS, uri_parts[1]));
}
std::vector<const CBlockIndex*> headers;