From a57ef3d71cdefd54c13dfcff87b401abb83ca0f9 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 24 Apr 2014 12:53:48 +0200 Subject: [PATCH] Refs #5474 --- centreon/plugins/httplib.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centreon/plugins/httplib.pm b/centreon/plugins/httplib.pm index 7ca20c856..d0d700c8f 100644 --- a/centreon/plugins/httplib.pm +++ b/centreon/plugins/httplib.pm @@ -48,7 +48,7 @@ sub connect { my ($response, $content); my $req; - if (defined($self->{option_results}->{port})) { + if (defined($self->{option_results}->{port}) && $self->{option_results}->{port} =~ /^[0-9]+$/) { $req = HTTP::Request->new( GET => $self->{option_results}->{proto}. "://" . $self->{option_results}->{hostname}.':'. $self->{option_results}->{port} . $self->{option_results}->{url_path}); } else { $req = HTTP::Request->new( GET => $self->{option_results}->{proto}. "://" . $self->{option_results}->{hostname} . $self->{option_results}->{url_path});