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:
parent
5d5c9d3e7c
commit
eff10e0cda
@ -104,10 +104,12 @@ def extract(cnt, dest=None):
|
|||||||
with tempfile.TemporaryDirectory() as temp:
|
with tempfile.TemporaryDirectory() as temp:
|
||||||
cmdline = ["tar", "--no-same-owner", "--no-same-permissions"]
|
cmdline = ["tar", "--no-same-owner", "--no-same-permissions"]
|
||||||
if dest is not None:
|
if dest is not None:
|
||||||
cmdline.append("-xvC")
|
cmdline.append("-xC")
|
||||||
cmdline.append(temp)
|
cmdline.append(temp)
|
||||||
else:
|
else:
|
||||||
cmdline.append("-t")
|
cmdline.append("-t")
|
||||||
|
if len(data) < 3145728:
|
||||||
|
cmdline.append("-v")
|
||||||
if type in ["application/gzip", "application/x-gzip"]:
|
if type in ["application/gzip", "application/x-gzip"]:
|
||||||
cmdline.append("-z")
|
cmdline.append("-z")
|
||||||
elif type in ["application/xz", "application/x-xz"]:
|
elif type in ["application/xz", "application/x-xz"]:
|
||||||
|
Reference in New Issue
Block a user