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' ]],
|
||||
},
|
||||
protected => 1,
|
||||
download => 1,
|
||||
download_allowed => 1,
|
||||
parameters => {
|
||||
additionalProperties => 0,
|
||||
properties => {
|
||||
|
@ -327,7 +327,7 @@ __PACKAGE__->register_method({
|
||||
user => 'all',
|
||||
},
|
||||
protected => 1,
|
||||
download => 1,
|
||||
download_allowed => 1,
|
||||
description => "Read task log.",
|
||||
proxyto => 'node',
|
||||
parameters => {
|
||||
|
@ -351,7 +351,12 @@ sub call_api_method {
|
||||
|
||||
$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})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user