mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-25 22:55:15 +02:00
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.
This commit is contained in:
parent
157eb81cfa
commit
dc564ea9ce
@ -212,12 +212,6 @@ sub set_proxy {
|
|||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
if (defined($options{request}->{proxyurl}) && $options{request}->{proxyurl} ne '') {
|
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});
|
$self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_PROXY'), parameter => $options{request}->{proxyurl});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user