Skip to content
This repository
Browse code

Removing supressing errors from HttpSocket, using condition instead. …

…Fixes #6483.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8232 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit 3b872a218ed89c0e2c7291ff6bc1d253f2b7d987 1 parent baea319
Renan Gonçalves authored July 15, 2009

Showing 1 changed file with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. 11  cake/libs/http_socket.php
11  cake/libs/http_socket.php
@@ -220,7 +220,10 @@ function request($request = array()) {
220 220
 			$this->request['header']['Content-Length'] = strlen($this->request['body']);
221 221
 		}
222 222
 
223  
-		$connectionType = @$this->request['header']['Connection'];
  223
+		$connectionType = null;
  224
+		if (isset($this->request['header']['Connection'])) {
  225
+			$connectionType = $this->request['header']['Connection'];
  226
+		}
224 227
 		$this->request['header'] = $this->buildHeader($this->request['header']).$cookies;
225 228
 
226 229
 		if (empty($this->request['line'])) {
@@ -395,7 +398,11 @@ function parseResponse($message) {
395 398
 		}
396 399
 
397 400
 		$response['header'] = $this->parseHeader($response['raw']['header']);
398  
-		$decoded = $this->decodeBody($response['raw']['body'], @$response['header']['Transfer-Encoding']);
  401
+		$transferEncoding = null;
  402
+		if (isset($response['header']['Transfer-Encoding'])) {
  403
+			$transferEncoding = $response['header']['Transfer-Encoding'];
  404
+		}
  405
+		$decoded = $this->decodeBody($response['raw']['body'], $transferEncoding);
399 406
 		$response['body'] = $decoded['body'];
400 407
 
401 408
 		if (!empty($decoded['header'])) {

0 notes on commit 3b872a2

Please sign in to comment.
Something went wrong with that request. Please try again.