diff options
author | Jeff Garzik <jgarzik@bitpay.com> | 2014-11-18 10:27:45 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@bitpay.com> | 2014-11-18 10:27:45 -0500 |
commit | 7715c847472f565ca79429db0d8505f126617878 (patch) | |
tree | e3399c00b56767c774081412e02874e038b8042a /src/rest.cpp | |
parent | 9445b876bde34c0cc4ca9cb16fbd763fe877b8a9 (diff) |
HTTP REST: minor fixes
1) const-ify internal helper ParseHashStr()
2) use HTTPError() helper when returning HTTP_NOT_FOUND
Diffstat (limited to 'src/rest.cpp')
-rw-r--r-- | src/rest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rest.cpp b/src/rest.cpp index 48c1672ae8..89075887a0 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -56,7 +56,7 @@ static enum RetFormat ParseDataFormat(const string& format) return rf_names[0].rf; } -static bool ParseHashStr(string& strReq, uint256& v) +static bool ParseHashStr(const string& strReq, uint256& v) { if (!IsHex(strReq) || (strReq.size() != 64)) return false; @@ -195,7 +195,7 @@ bool HTTPReq_REST(AcceptedConnection *conn, return false; } - conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush; + conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush; return false; } |