fix empty timeout lwp (#2629)

This commit is contained in:
qgarnier 2021-03-02 14:33:23 +01:00 committed by GitHub
parent a10dd0b4a2
commit c24dc16327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -137,10 +137,12 @@ sub request {
my $request_options = $options{request};
if (!defined($self->{ua})) {
my $timeout;
$timeout = $1 if (defined($request_options->{timeout}) && $request_options->{timeout} =~ /(\d+)/);
$self->{ua} = centreon::plugins::backend::http::useragent->new(
%user_agent_params,
protocols_allowed => ['http', 'https'],
timeout => $request_options->{timeout},
timeout => $timeout,
credentials => $request_options->{credentials},
username => $request_options->{username},
password => $request_options->{password}