Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/Zabbix/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package Zabbix::API;
use strict;
use warnings;
use 5.010;
use experimental qw< switch >;

use Params::Validate qw/:all/;
use Carp qw/carp croak confess cluck/;
Expand Down Expand Up @@ -150,6 +151,9 @@ sub raw_query {
$args{'jsonrpc'} = '2.0';
$args{'auth'} = $self->cookie || '';
$args{'id'} = $global_id++;
$args{'params'} //= {};
delete $args{'auth'}
if grep /^$args{method}$/, qw< user.login apiinfo.version >;

my $response = eval { $self->{ua}->post($self->{server},
'Content-Type' => 'application/json-rpc',
Expand Down