Skip to content

Commit 5ed48c8

Browse files
committed
Do not clone the initial request so that it is replaced correctly.
Cloning the initial request resulted in the cloned request being replaced once an internal request had been dispatched. This proved troublesome for middlewares that altered the initial request as the cloned request then replaced the initial request after an internal request was dispatched. Reference issue dingo#894.
1 parent 97c9220 commit 5ed48c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Dispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ public function __construct(Container $container, Filesystem $files, Router $rou
183183
}
184184

185185
/**
186-
* Setup the request stack by cloning the initial request.
186+
* Setup the request stack by grabbing the initial request.
187187
*
188188
* @return void
189189
*/
190190
protected function setupRequestStack()
191191
{
192-
$this->requestStack[] = clone $this->container['request'];
192+
$this->requestStack[] = $this->container['request'];
193193
}
194194

195195
/**

0 commit comments

Comments
 (0)