Skip to content

Commit 6df875e

Browse files
committed
Headers are now added from the original request
1 parent 09ba846 commit 6df875e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Router.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ public function singleRequest($method, $uri, array $data = [], array $headers =
116116
// after we've completed our internal request.
117117
$currentRequest = $this->request->instance()->duplicate();
118118

119+
$headers = $this->overrideHeaders($currentRequest->headers->all(), $headers);
120+
119121
if ($this->disableMiddleware) {
120122
$this->app->instance('middleware.disable', true);
121123
}
@@ -141,6 +143,11 @@ public function singleRequest($method, $uri, array $data = [], array $headers =
141143
return $response;
142144
}
143145

146+
private function overrideHeaders(array $default, array $headers)
147+
{
148+
return array_merge($default, $headers);
149+
}
150+
144151
public function enableMiddleware()
145152
{
146153
$this->disableMiddleware = false;

0 commit comments

Comments
 (0)