api request helper: fix conditional declaration

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2025-03-06 09:55:47 +01:00
parent 35b9c672a0
commit f247794dda

View file

@ -262,7 +262,7 @@ sub encode_value {
sub api_request {
my ($method, $url, $headers, $data, $expected_fingerprint) = @_;
my $encoded_data = to_json($data) if $data;
my $encoded_data = $data ? to_json($data) : undef;
my $req = HTTP::Request->new($method,$url, $headers, $encoded_data);