Skip to content

Commit

Permalink
Fix a bug where only HTTP 200 response codes were accepted as success (
Browse files Browse the repository at this point in the history
…#95)

* Accept more response statuses

Http 2xx range are all success statuses, so should be accepted without raising `MultiPartDownloadError`.

* Update parfive/downloader.py

Co-authored-by: Stuart Mumford <stuart@cadair.com>

Co-authored-by: Stuart Mumford <stuart@cadair.com>
  • Loading branch information
SolarDrew and Cadair authored Jun 16, 2022
1 parent 7ded450 commit 4254371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parfive/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ async def _http_download_worker(self, session, url, chunksize, http_range, queue
resp.headers,
)

if resp.status != 200:
if resp.status < 200 or resp.status > 300:
raise MultiPartDownloadError(resp)

while True:
Expand Down

0 comments on commit 4254371

Please # to comment.