Fixes last-byte-pos interpretation.
This commit is contained in:
parent
185b49ad66
commit
2cdab4cab9
1 changed files with 1 additions and 1 deletions
|
|
@ -252,7 +252,7 @@ class ResponseObject(_TemplateEnvironmentMixin):
|
||||||
toint = lambda i: int(i) if i else None
|
toint = lambda i: int(i) if i else None
|
||||||
begin, end = map(toint, rspec.split('-'))
|
begin, end = map(toint, rspec.split('-'))
|
||||||
if begin is not None: # byte range
|
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
|
elif end is not None: # suffix byte range
|
||||||
begin = length - end
|
begin = length - end
|
||||||
end = last
|
end = last
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue