From dc564ea9ce96afc33e05408a03bcd07a0e11dc51 Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Fri, 20 Dec 2019 16:22:45 +0100 Subject: [PATCH] Remove useless proxyurl handling from cURL HTTP backend https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html > A proxy host string can also include protocol scheme (http://) > and embedded user + password. --- centreon/plugins/backend/http/curl.pm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/centreon/plugins/backend/http/curl.pm b/centreon/plugins/backend/http/curl.pm index bf8472be5..d80e75472 100644 --- a/centreon/plugins/backend/http/curl.pm +++ b/centreon/plugins/backend/http/curl.pm @@ -212,12 +212,6 @@ sub set_proxy { my ($self, %options) = @_; if (defined($options{request}->{proxyurl}) && $options{request}->{proxyurl} ne '') { - if ($options{request}->{proxyurl} =~ /^(?:http|https):\/\/(.*?):(.*?)@/) { - $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_PROXYUSERNAME'), parameter => $1); - $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_PROXYPASSWORD'), parameter => $2); - $options{request}->{proxyurl} =~ s/\/\/$1:$2@//; - } - $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_PROXY'), parameter => $options{request}->{proxyurl}); }