When the tarball is too heavy, don't display its content

This avoid an infinite wait due to a full buffer
This commit is contained in:
nemunaire 2022-04-27 12:09:00 +02:00
parent 5d5c9d3e7c
commit eff10e0cda
1 changed files with 3 additions and 1 deletions

View File

@ -104,10 +104,12 @@ def extract(cnt, dest=None):
with tempfile.TemporaryDirectory() as temp:
cmdline = ["tar", "--no-same-owner", "--no-same-permissions"]
if dest is not None:
cmdline.append("-xvC")
cmdline.append("-xC")
cmdline.append(temp)
else:
cmdline.append("-t")
if len(data) < 3145728:
cmdline.append("-v")
if type in ["application/gzip", "application/x-gzip"]:
cmdline.append("-z")
elif type in ["application/xz", "application/x-xz"]: