Skip to content

Commit

Permalink
fix: content_range should not be reduced by one.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpeng3 authored and pgjones committed May 19, 2024
1 parent d5b5a99 commit ba31554
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Fixed Issue #331. Use ContentRange in the right way.

0.19.5 2024-04-01
-----------------

Expand Down
2 changes: 1 addition & 1 deletion src/quart/wrappers/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ async def _process_range_request(
self.content_range = ContentRange(
request_range.units,
self.response.begin, # type: ignore
self.response.end - 1, # type: ignore
self.response.end, # type: ignore
complete_length,
)
self.status_code = 206
Expand Down
2 changes: 1 addition & 1 deletion tests/wrappers/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def test_response_make_conditional(http_scope: HTTPScope) -> None:
assert response.accept_ranges == "bytes"
assert response.content_range.units == "bytes"
assert response.content_range.start == 0
assert response.content_range.stop == 3
assert response.content_range.stop == 4
assert response.content_range.length == 6


Expand Down

0 comments on commit ba31554

Please sign in to comment.