From 1df6a5372c89d8bb9c31c024f86e6198134c56a3 Mon Sep 17 00:00:00 2001 From: Colin Gagnaire Date: Wed, 17 Apr 2019 14:16:25 +0200 Subject: [PATCH] fix lwp backend authentication verif --- centreon/plugins/backend/http/lwp.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/centreon/plugins/backend/http/lwp.pm b/centreon/plugins/backend/http/lwp.pm index e2186490e..bce6c8760 100644 --- a/centreon/plugins/backend/http/lwp.pm +++ b/centreon/plugins/backend/http/lwp.pm @@ -241,8 +241,9 @@ sub request { if (!$self->{output}->is_status(value => $status, compare => 'ok', litteral => 1)) { my $short_msg = $self->{response}->status_line; if ($short_msg =~ /^401/) { - my ($authenticate) = $self->{response}->www_authenticate =~ /(\S+)/; - $short_msg .= ' (' . $authenticate . ' authentication expected)'; + my $authenticate = ''; + $short_msg .= ' (' . $1 . ' authentication expected)' if (defined($self->{response}->www_authenticate) && + $self->{response}->www_authenticate =~ /(\S+)/); } $self->{output}->output_add(long_msg => $self->{response}->content, debug => 1);