allow object as return value for 'download' api calls
this way, we can give additional information for download apis
(like the content-type and if it should be deleted after)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
};
if ($info->{download}) {
- die "download methods should have return type 'string' - internal error"
- if ($info->{returns}->{type} ne 'string');
- $resp->{download} = $result;
+ my $type = $info->{returns}->{type};
+ if ($type eq 'string' || $type eq 'object') {
+ $resp->{download} = $result;
+ } else {
+ die "API calls which trigger downloads need to have return type 'string' or 'object' - internal error"
+ }
+
} else {
$resp->{data} = $result;
}