Fixes last-byte-pos interpretation.

This commit is contained in:
MurphyMarkW 2015-06-29 20:25:22 -05:00
parent 185b49ad66
commit 2cdab4cab9

View File

@ -252,7 +252,7 @@ class ResponseObject(_TemplateEnvironmentMixin):
toint = lambda i: int(i) if i else None
begin, end = map(toint, rspec.split('-'))
if begin is not None: # byte range
end = last if end is None else end
end = last if end is None else min(end, last)
elif end is not None: # suffix byte range
begin = length - end
end = last