need to set context even for no proxy, if we need optional authentication

This commit is contained in:
Ralf Becker 2014-09-23 13:45:03 +00:00
parent 1289d23df9
commit 19d2b7effb

View File

@ -986,13 +986,12 @@ abstract class egw_framework
*/
public static function proxy_context($username=null, $password=null)
{
if (empty($GLOBALS['egw_info']['server']['httpproxy_server']))
{
return null;
}
$opts = array(
'method' => 'GET',
);
if (!empty($GLOBALS['egw_info']['server']['httpproxy_server']))
{
$opts += array (
'proxy' => 'tcp://'.$GLOBALS['egw_info']['server']['httpproxy_server'].':'.
($GLOBALS['egw_info']['server']['httpproxy_port'] ? $GLOBALS['egw_info']['server']['httpproxy_port'] : 8080),
'request_fulluri' => true,
@ -1003,6 +1002,7 @@ abstract class egw_framework
$opts['header'][] = 'Proxy-Authorization: Basic '.base64_encode($GLOBALS['egw_info']['server']['httpproxy_server_username'].':'.
$GLOBALS['egw_info']['server']['httpproxy_server_password']);
}
}
// optional authentication
if (isset($username))
{