Skip to content

Commit

Permalink
Headers are now added from the original request
Browse files Browse the repository at this point in the history
  • Loading branch information
esbenp committed Jun 26, 2015
1 parent 09ba846 commit 6df875e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public function singleRequest($method, $uri, array $data = [], array $headers =
// after we've completed our internal request.
$currentRequest = $this->request->instance()->duplicate();

$headers = $this->overrideHeaders($currentRequest->headers->all(), $headers);

if ($this->disableMiddleware) {
$this->app->instance('middleware.disable', true);
}
Expand All @@ -141,6 +143,11 @@ public function singleRequest($method, $uri, array $data = [], array $headers =
return $response;
}

private function overrideHeaders(array $default, array $headers)
{
return array_merge($default, $headers);
}

public function enableMiddleware()
{
$this->disableMiddleware = false;
Expand Down

0 comments on commit 6df875e

Please sign in to comment.