@@ -74,23 +74,23 @@ |
||
74 | 74 | */ |
75 | 75 | private function adjustHeaders($requestType) |
76 | 76 | { |
77 | - if (! array_key_exists('Accept', $this->headers) && $requestType != 'HEAD') { |
|
77 | + if (!array_key_exists('Accept', $this->headers) && $requestType != 'HEAD') { |
|
78 | 78 | $this->setHeader('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'); |
79 | 79 | } |
80 | 80 | |
81 | - if (! array_key_exists('Accept-Language', $this->headers) && $requestType != 'HEAD') { |
|
81 | + if (!array_key_exists('Accept-Language', $this->headers) && $requestType != 'HEAD') { |
|
82 | 82 | $this->setHeader('Accept-Language', 'en-US;q=0.7,en;q=0.3'); |
83 | 83 | } |
84 | 84 | |
85 | - if (! array_key_exists('User-Agent', $this->headers) && $requestType != 'HEAD') { |
|
85 | + if (!array_key_exists('User-Agent', $this->headers) && $requestType != 'HEAD') { |
|
86 | 86 | $this->setHeader('User-Agent', 'phpGenerics 1.0'); |
87 | 87 | } |
88 | 88 | |
89 | - if (! array_key_exists('Connection', $this->headers) || strlen($this->headers['Connection']) == 0) { |
|
89 | + if (!array_key_exists('Connection', $this->headers) || strlen($this->headers['Connection']) == 0) { |
|
90 | 90 | $this->adjustConnectionHeader($requestType); |
91 | 91 | } |
92 | 92 | |
93 | - if (! array_key_exists('Accept-Encoding', $this->headers)) { |
|
93 | + if (!array_key_exists('Accept-Encoding', $this->headers)) { |
|
94 | 94 | if (function_exists('gzinflate')) { |
95 | 95 | $encoding = 'gzip, deflate'; |
96 | 96 | } else { |
@@ -93,7 +93,8 @@ discard block |
||
93 | 93 | if (! array_key_exists('Accept-Encoding', $this->headers)) { |
94 | 94 | if (function_exists('gzinflate')) { |
95 | 95 | $encoding = 'gzip, deflate'; |
96 | - } else { |
|
96 | + } |
|
97 | + else { |
|
97 | 98 | $encoding = 'identity'; |
98 | 99 | } |
99 | 100 | $this->setHeader('Accept-Encoding', $encoding); |
@@ -110,7 +111,8 @@ discard block |
||
110 | 111 | { |
111 | 112 | if ($requestType == 'HEAD') { |
112 | 113 | $this->setHeader('Connection', 'close'); |
113 | - } else { |
|
114 | + } |
|
115 | + else { |
|
114 | 116 | $this->setHeader('Connection', 'keep-alive'); |
115 | 117 | } |
116 | 118 | } |
@@ -124,7 +126,8 @@ discard block |
||
124 | 126 | { |
125 | 127 | if (strpos($line, ':') === false) { |
126 | 128 | $this->responseCode = HttpStatus::parseStatus($line)->getCode(); |
127 | - } else { |
|
129 | + } |
|
130 | + else { |
|
128 | 131 | $line = trim($line); |
129 | 132 | list ($headerName, $headerValue) = explode(':', $line, 2); |
130 | 133 | $this->headers[$headerName] = trim($headerValue); |