Fix serving binary files with zero characters in it.
This commit is contained in:
parent
bb7af2e8ed
commit
350ee13d66
1 changed files with 4 additions and 3 deletions
|
@ -620,6 +620,7 @@ class FileRequestPlugin(object):
|
|||
if file.read(10) == b"\0" * 10:
|
||||
# Looks empty, but makes sures we don't have that piece
|
||||
file_info = site.content_manager.getFileInfo(inner_path)
|
||||
if "piece_size" in file_info:
|
||||
piece_i = int(pos / file_info["piece_size"])
|
||||
if not site.storage.piecefields[file_info["sha512"]][piece_i]:
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue