mirror of
https://github.com/monero-project/monero.git
synced 2026-07-28 14:47:15 -07:00
common: validate Content-Range resume offset
This commit is contained in:
@@ -125,10 +125,9 @@ namespace tools
|
||||
{
|
||||
// we requested a range, so check if we're getting it, otherwise truncate
|
||||
bool got_range = false;
|
||||
const std::string prefix = "bytes=" + std::to_string(offset) + "-";
|
||||
for (const auto &kv: headers.m_header_info.m_etc_fields)
|
||||
{
|
||||
if (kv.first == "Content-Range" && strncmp(kv.second.c_str(), prefix.c_str(), prefix.size()))
|
||||
if (kv.first == "Content-Range" && tools::content_range_starts_at(kv.second, offset))
|
||||
{
|
||||
got_range = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user