From 29f05762699e25cca37691c42aa31c3a181626b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20Bl=C3=B6m?= Date: Wed, 1 Mar 2017 15:04:10 -0800 Subject: [PATCH] changed range handler to support any case header --- sanic/handlers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/handlers.py b/sanic/handlers.py index d5a5d0dd..842b127e 100644 --- a/sanic/handlers.py +++ b/sanic/handlers.py @@ -97,7 +97,8 @@ class ContentRangeHandler: def __init__(self, request, stats): 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: raise HeaderNotFound('Range Header Not Found') unit, _, value = tuple(map(str.strip, _range.partition('=')))