Skip to content

Commit

Permalink
better fixes aio-libs#1595
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-eri authored Mar 9, 2017
1 parent 8e8ad67 commit a8bf673
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aiohttp/file_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ def send(self, request, filepath):
# If a range request has been made, convert start, end slice notation
# into file pointer offset and count
if start is not None or end is not None:
if start > 0 or end:
status = HTTPPartialContent.status_code
if start is None and end < 0: # return tail of file
start = file_size + end
count = -end
Expand All @@ -194,6 +192,9 @@ def send(self, request, filepath):
# the current length of the selected representation).
count = file_size - start

if count != file_size:
status = HTTPPartialContent.status_code

resp = self._response_factory(status=status)
resp.content_type = ct
if encoding:
Expand Down

0 comments on commit a8bf673

Please sign in to comment.