download handling: adapt to method schema field rename
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
2e489489ab
commit
69698ccc63
@ -906,7 +906,7 @@ __PACKAGE__->register_method({
|
|||||||
check => ['perm', '/nodes/{node}', [ 'Sys.Syslog' ]],
|
check => ['perm', '/nodes/{node}', [ 'Sys.Syslog' ]],
|
||||||
},
|
},
|
||||||
protected => 1,
|
protected => 1,
|
||||||
download => 1,
|
download_allowed => 1,
|
||||||
parameters => {
|
parameters => {
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
properties => {
|
properties => {
|
||||||
|
@ -327,7 +327,7 @@ __PACKAGE__->register_method({
|
|||||||
user => 'all',
|
user => 'all',
|
||||||
},
|
},
|
||||||
protected => 1,
|
protected => 1,
|
||||||
download => 1,
|
download_allowed => 1,
|
||||||
description => "Read task log.",
|
description => "Read task log.",
|
||||||
proxyto => 'node',
|
proxyto => 'node',
|
||||||
parameters => {
|
parameters => {
|
||||||
|
@ -351,7 +351,12 @@ sub call_api_method {
|
|||||||
|
|
||||||
$data = $handler->handle($info, $param);
|
$data = $handler->handle($info, $param);
|
||||||
|
|
||||||
if (ref($data) eq 'HASH' && ref($data->{download}) eq 'HASH' && $info->{download}) {
|
# TODO: remove 'download' check with PVE 9.0
|
||||||
|
if (
|
||||||
|
ref($data) eq 'HASH'
|
||||||
|
&& ref($data->{download}) eq 'HASH'
|
||||||
|
&& ($info->{download_allowed} || $info->{download})
|
||||||
|
) {
|
||||||
$data = $handle_streamed_response->($data->{download})
|
$data = $handle_streamed_response->($data->{download})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user