Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dcb3833

Browse files
committed
Use clone instead of Request::duplicate()
1 parent 5a7aefd commit dcb3833

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
165165
// FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism
166166
if (HttpKernelInterface::MASTER_REQUEST === $type) {
167167
$this->traces = array();
168-
// Keep a duplicate of the original request for surrogates so they can access it.
169-
// We must duplicate here to get a separate instance because the application will modify the request during
168+
// Keep a clone of the original request for surrogates so they can access it.
169+
// We must clone here to get a separate instance because the application will modify the request during
170170
// the application flow (we know it always does because we do ourselves by setting REMOTE_ADDR to 127.0.0.1
171171
// and adding the X-Forwarded-For header, see HttpCache::forward()).
172-
$this->request = $request->duplicate();
172+
$this->request = clone $request;
173173
if (null !== $this->surrogate) {
174174
$this->surrogateCacheStrategy = $this->surrogate->createCacheStrategy();
175175
}

0 commit comments

Comments
 (0)