diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index 01e074589e7..8b134a9f36b 100644 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -177,9 +177,9 @@ public function connect() { $req[] = 'Host: ' . $this->config['host']; $req[] = 'User-Agent: php proxy'; - fwrite($this->connection, implode("\r\n", $req)."\r\n\r\n"); + fwrite($this->connection, implode("\r\n", $req) . "\r\n\r\n"); - while(true) { + while (!feof($this->connection)) { $s = rtrim(fgets($this->connection, 4096)); if (preg_match('/^$/', $s)) { break;