mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-18 02:51:06 +00:00
HTTP REST: minor fixes
1) const-ify internal helper ParseHashStr() 2) use HTTPError() helper when returning HTTP_NOT_FOUND
This commit is contained in:
parent
9445b876bd
commit
7715c84747
@ -56,7 +56,7 @@ static enum RetFormat ParseDataFormat(const string& format)
|
|||||||
return rf_names[0].rf;
|
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))
|
if (!IsHex(strReq) || (strReq.size() != 64))
|
||||||
return false;
|
return false;
|
||||||
@ -195,7 +195,7 @@ bool HTTPReq_REST(AcceptedConnection *conn,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush;
|
conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -957,7 +957,7 @@ void ServiceConnection(AcceptedConnection *conn)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush;
|
conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user