diff --git a/src/JPush/JPush.php b/src/JPush/JPush.php index 7c8671b..31374e1 100644 --- a/src/JPush/JPush.php +++ b/src/JPush/JPush.php @@ -129,11 +129,13 @@ public function _request($url, $method, $body=null, $times=1) { $body = substr($output, $header_size); $headers = array(); foreach (explode("\r\n", $header_text) as $i => $line) { - if ($i === 0) { - $headers['http_code'] = $line; - } else { - list ($key, $value) = explode(': ', $line); - $headers[$key] = $value; + if (!empty($line)) { + if ($i === 0) { + $headers['http_code'] = $line; + } else { + list ($key, $value) = explode(': ', $line); + $headers[$key] = $value; + } } } $response['headers'] = $headers;