diff --git a/src/Client/Response.php b/src/Client/Response.php index 5988423..aabc7cf 100644 --- a/src/Client/Response.php +++ b/src/Client/Response.php @@ -17,7 +17,7 @@ class Response $match = []; preg_match( - '/(?\d{2})\s(?.*)\r\n(?.*)/su', + '/^(?\d{2})(?.*)$/m', $data, $match ); @@ -37,14 +37,16 @@ class Response if (isset($match['meta']) && mb_strlen($match['meta']) <= 1024) { $this->setMeta( - (string) $match['meta'] + trim( + (string) $match['meta'] + ) ); } - if (isset($match['body'])) + if ($body = substr($data, strpos($data, chr(10)) + 1)) { $this->setBody( - (string) (string) $match['body'] + (string) $body ); } }