MDL-76370 curl: suppress CONNECT header when using HTTP proxy

This commit is contained in:
Jaydn Cunningham 2022-11-23 12:32:33 +10:30
parent df502b3e4c
commit 6ad6b28a34

View File

@ -3215,7 +3215,14 @@ class curl {
$this->proxy_type = CURLPROXY_SOCKS5;
} else {
$this->proxy_type = CURLPROXY_HTTP;
$this->setopt(array('httpproxytunnel'=>false));
$this->setopt([
'httpproxytunnel' => false,
]);
if (defined('CURLOPT_SUPPRESS_CONNECT_HEADERS')) {
$this->setopt([
'suppress_connect_headers' => true,
]);
}
}
$this->setopt(array('proxytype'=>$this->proxy_type));
}