mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 16:14:21 +02:00
fix empty timeout lwp (#2629)
This commit is contained in:
parent
18762b2d30
commit
ba46b59753
@ -137,10 +137,12 @@ sub request {
|
|||||||
|
|
||||||
my $request_options = $options{request};
|
my $request_options = $options{request};
|
||||||
if (!defined($self->{ua})) {
|
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(
|
$self->{ua} = centreon::plugins::backend::http::useragent->new(
|
||||||
%user_agent_params,
|
%user_agent_params,
|
||||||
protocols_allowed => ['http', 'https'],
|
protocols_allowed => ['http', 'https'],
|
||||||
timeout => $request_options->{timeout},
|
timeout => $timeout,
|
||||||
credentials => $request_options->{credentials},
|
credentials => $request_options->{credentials},
|
||||||
username => $request_options->{username},
|
username => $request_options->{username},
|
||||||
password => $request_options->{password}
|
password => $request_options->{password}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user