Skip to content

Commit

Permalink
Fix for out-of-date Request and Response objects in main application …
Browse files Browse the repository at this point in the history
…instance
  • Loading branch information
DaGhostman committed Mar 21, 2015
1 parent f9f9415 commit 7c6d872
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Wave/Framework/Application/Wave.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,18 @@ public static function __callStatic($name, $args = [])
*/
public function run($factory, $input = null, $output = null)
{
$this->request = new Request();
$request = new Request();
if ($input) {
$this->request = $this->request->withBody($input);
$request = $request->withBody($input);
}

$this->response = new Response();
$response = new Response();
if ($output) {
$this->response = $this->response->withBody($output);
$response = $response->withBody($output);
}

$factory->withRequest($this->request)
->withResponse($this->response);
$this->request = $factory->withRequest($request);
$this->response = $factory->withResponse($response);

$dispatcher = call_user_func($this->dispatcher, $this->router, $this->container);

Expand Down

0 comments on commit 7c6d872

Please sign in to comment.