fix range-request on empty files

This commit is contained in:
ed 2022-10-24 03:26:32 +02:00
parent 5b6194d131
commit cce57b700b

View file

@ -2253,7 +2253,7 @@ class HttpCli(object):
hrange = self.headers.get("range")
# let's not support 206 with compression
if do_send and not is_compressed and hrange:
if do_send and not is_compressed and hrange and file_sz:
try:
a, b = hrange.split("=", 1)[1].split("-")