diff vendor/symfony/http-kernel/HttpCache/HttpCache.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 1fec387a4317
children 129ea1e6d783
line wrap: on
line diff
--- a/vendor/symfony/http-kernel/HttpCache/HttpCache.php	Thu Apr 26 11:26:54 2018 +0100
+++ b/vendor/symfony/http-kernel/HttpCache/HttpCache.php	Tue Jul 10 15:07:59 2018 +0100
@@ -165,7 +165,11 @@
         // FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism
         if (HttpKernelInterface::MASTER_REQUEST === $type) {
             $this->traces = array();
-            $this->request = $request;
+            // Keep a clone of the original request for surrogates so they can access it.
+            // We must clone here to get a separate instance because the application will modify the request during
+            // the application flow (we know it always does because we do ourselves by setting REMOTE_ADDR to 127.0.0.1
+            // and adding the X-Forwarded-For header, see HttpCache::forward()).
+            $this->request = clone $request;
             if (null !== $this->surrogate) {
                 $this->surrogateCacheStrategy = $this->surrogate->createCacheStrategy();
             }