Byte ranges are inclusive

The second component of a byte range, if present, designates the
index of the last byte to be included in the partial response.
This commit is contained in:
Veloman Yunkan 2020-05-22 16:30:43 +04:00
parent 2bf35f1651
commit 1a99bacfe3
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ int get_range_len(const kiwix::Entry& entry, RequestContext::ByteRange range)
{ {
return range.second == -1 return range.second == -1
? entry.getSize() - range.first ? entry.getSize() - range.first
: range.second - range.first; : range.second - range.first + 1;
} }
} // unnamed namespace } // unnamed namespace