mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Fixed a bug in HttpServer where the byte range response header's "to"
field may be larger than the size.
This commit is contained in:
parent
fb869e27b3
commit
d8b0aef307
@ -175,7 +175,15 @@ static Range* parseRange(IDataStream* file, const char* range) {
|
||||
|
||||
if (to > from) {
|
||||
result->from = from;
|
||||
result->to = (to == 0) ? 0 : to - 1;
|
||||
if (to == 0) {
|
||||
result->to = 0;
|
||||
}
|
||||
else if (to >= size) {
|
||||
result->to = size - 1;
|
||||
}
|
||||
else {
|
||||
result->to = to - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...) {
|
||||
|
Loading…
Reference in New Issue
Block a user