mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
inc: remove proxy usage from alias download function
This commit is contained in:
parent
60b543e5ee
commit
470861be3f
@ -402,21 +402,11 @@ function download_file($url, $destination, $verify_ssl = false, $connect_timeout
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/usr/local/opnsense/version/opnsense")));
|
||||
|
||||
if (!empty($config['system']['proxyurl'])) {
|
||||
curl_setopt($ch, CURLOPT_PROXY, $config['system']['proxyurl']);
|
||||
if (!empty($config['system']['proxyport'])) {
|
||||
curl_setopt($ch, CURLOPT_PROXYPORT, $config['system']['proxyport']);
|
||||
}
|
||||
if (!empty($config['system']['proxyuser']) && !empty($config['system']['proxypass'])) {
|
||||
@curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_ANY | CURLAUTH_ANYSAFE);
|
||||
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "{$config['system']['proxyuser']}:{$config['system']['proxypass']}");
|
||||
}
|
||||
}
|
||||
|
||||
@curl_exec($ch);
|
||||
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
fclose($fp);
|
||||
curl_close($ch);
|
||||
|
||||
return ($http_code == 200) ? true : $http_code;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user