diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm index a8d60c1..943d6cc 100644 --- a/src/PVE/APIServer/AnyEvent.pm +++ b/src/PVE/APIServer/AnyEvent.pm @@ -989,8 +989,12 @@ sub handle_api2_request { $download //= $res->{data}->{download} if defined($res->{data}) && ref($res->{data}) eq 'HASH'; if (defined($download)) { - send_file_start($self, $reqstate, $download); - return; + if ($res->{info}->{download}) { + send_file_start($self, $reqstate, $download); + return; + } else { + warn "Download attempted for non-marked API endpoint '$path'\n"; + } } my ($raw, $ct, $nocomp) = $formatter->($res, $res->{data}, $params, $path,