changed range handler to support any case header

This commit is contained in:
Kyle Blöm 2017-03-01 15:04:10 -08:00
parent b87dc37fbb
commit 29f0576269

View File

@ -97,7 +97,8 @@ class ContentRangeHandler:
def __init__(self, request, stats): def __init__(self, request, stats):
self.total = stats.st_size self.total = stats.st_size
_range = request.headers.get('Range') _range = {k.lower(): v for k, v in request.headers.items()}.get(
'range')
if _range is None: if _range is None:
raise HeaderNotFound('Range Header Not Found') raise HeaderNotFound('Range Header Not Found')
unit, _, value = tuple(map(str.strip, _range.partition('='))) unit, _, value = tuple(map(str.strip, _range.partition('=')))