mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-05-02 10:20:50 +00:00
allow 'download' to be passed from API handler
PVE::HTTPServer in pve-manager wraps the API return value in a 'data' element, look for a 'download' element there too to allow an API call to instruct the HTTP server to return a file via path or filehandle. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
e22eccff31
commit
6d832dbced
@ -812,7 +812,10 @@ sub handle_api2_request {
|
||||
$delay = 0 if $delay < 0;
|
||||
}
|
||||
|
||||
if (defined(my $download = $res->{download})) {
|
||||
my $download = $res->{download};
|
||||
$download //= $res->{data}->{download}
|
||||
if defined($res->{data}) && ref($res->{data}) eq 'HASH';
|
||||
if (defined($download)) {
|
||||
send_file_start($self, $reqstate, $download);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user