From 8d7c9545445d24ca843fe25cdde7541baece092a Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Wed, 3 Aug 2011 13:36:59 +0000 Subject: [PATCH] sticking to the rules of the protocoll while writing a request to port, ensures that lighttpd (>=1.4.28) understands our requests --- phpgwapi/inc/class.network.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpgwapi/inc/class.network.inc.php b/phpgwapi/inc/class.network.inc.php index 8be2ca64c4..5f32b3309e 100644 --- a/phpgwapi/inc/class.network.inc.php +++ b/phpgwapi/inc/class.network.inc.php @@ -191,7 +191,7 @@ //allows for access to http-auth pages - added by Dave Hall if(!((empty($user))&&(empty($passwd)))) { - $auth = 'Authorization: Basic '.base64_encode("$user:$passwd")."\n"; + $auth = 'Authorization: Basic '.base64_encode("$user:$passwd")."\r\n"; } else { @@ -205,11 +205,11 @@ { $proxyUsername = $GLOBALS['egw_info']['server']['httpproxy_server_username']; $proxyPassword = $GLOBALS['egw_info']['server']['httpproxy_server_password']; - $proxyAuth = 'Proxy-Authorization: Basic '.base64_encode("$proxyUsername:$proxyPassword")."\n"; + $proxyAuth = 'Proxy-Authorization: Basic '.base64_encode("$proxyUsername:$proxyPassword")."\r\n"; } if($this->open_port($server,80, 15)) { - if(!$this->write_port('GET http://' . $server . $file . ' HTTP/1.0'."\n".$proxyAuth.$auth."\r\n\r\n")) + if(!$this->write_port('GET http://' . $server . $file . ' HTTP/1.0'."\r\n".$proxyAuth.$auth."\r\n\r\n")) { return False; } @@ -237,10 +237,10 @@ } else { - if($this->open_port($server, 80, 15)) + if($this->open_port($server, 80, 30)) { $lines = array(); - if(!$this->write_port('GET '.$file.' HTTP/1.0'."\n".'Host: '.$server."\n".$auth."\r\n\r\n")) + if(!$this->write_port('GET '.$file.' HTTP/1.0'."\r\n".'Host: '.$server."\r\nAccept: */*".($auth?"\r\n".$auth:'')."\r\n\r\n")) { return 0; }