Skip to content

Commit

Permalink
Ensure Request::$data is always an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Bone committed Apr 2, 2013
1 parent f3f2b4d commit 98ca9f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Mongrel2/Request.php
Expand Up @@ -20,7 +20,7 @@ public function __construct($sender, $conn_id, $path, $headers, $body)
$this->body = $body;

if ($this->headers->METHOD == 'JSON') {
$this->data = json_decode($body);
$this->data = json_decode($body, true);
} else {
$this->data = array();
}
Expand All @@ -36,7 +36,7 @@ public static function parse($msg)
$body = $hd[0];

$headers = json_decode($headers);

return new Request($sender, $conn_id, $path, $headers, $body);
}

Expand Down

0 comments on commit 98ca9f1

Please sign in to comment.