Issue #2430335 Browser language detection is not cache aware
7 unresolved threads
Browser language detection is not cache aware
Closes #2430335
Merge request reports
Activity
added 1 commit
added 14 commits
-
f4905dd4...99804f40 - 13 commits from branch
project:11.x
- 5c1fdcf9 - Merge branch drupal:11.x into 2430335-browser-language-detection
-
f4905dd4...99804f40 - 13 commits from branch
added 1 commit
added 30 commits
-
943bb00c...a2c8988d - 29 commits from branch
project:11.x
- 774eba14 - Merge branch drupal:11.x into 2430335-browser-language-detection
-
943bb00c...a2c8988d - 29 commits from branch
6 use Drupal\Core\Cache\CacheableResponseInterface; 7 use Drupal\Core\PageCache\ResponsePolicyInterface; 8 use Symfony\Component\HttpFoundation\Request; 9 use Symfony\Component\HttpFoundation\Response; 10 11 /** 12 * A policy adding vary header to response. 13 */ 14 class Vary implements ResponsePolicyInterface { 15 16 /** 17 * Array of Vary: headers to add to response. 18 * 19 * @var array 20 */ 21 protected $vary = []; changed this line in version 7 of the diff
11 /** 12 * A policy adding vary header to response. 13 */ 14 class Vary implements ResponsePolicyInterface { 15 16 /** 17 * Array of Vary: headers to add to response. 18 * 19 * @var array 20 */ 21 protected $vary = []; 22 23 /** 24 * Add vary header. 25 */ 26 public function add($header) { changed this line in version 11 of the diff
20 */ 21 protected $vary = []; 22 23 /** 24 * Add vary header. 25 */ 26 public function add($header) { 27 if (!in_array($header, $this->vary)) { 28 $this->vary[] = $header; 29 } 30 } 31 32 /** 33 * {@inheritdoc} 34 */ 35 public function check(Response $response, Request $request) { changed this line in version 8 of the diff
31 /** 32 * {@inheritdoc} 33 */ 34 protected function setUp(): void { 35 parent::setUp(); 36 37 $this->config('system.site') 38 ->set('name', 'Drupal') 39 ->set('page.front', '/test-page') 40 ->save(); 41 } 42 43 /** 44 * Tests that custom vary header cached. 45 */ 46 public function testPageCacheWithVary() { changed this line in version 9 of the diff
37 public static function create(ContainerInterface $container) { 38 return new static( 39 $container->get('page_cache_vary') 40 ); 41 } 42 43 /** 44 * Page that displays content that depends on custom request header. 45 * 46 * @param \Symfony\Component\HttpFoundation\Request $request 47 * The request. 48 * 49 * @return array 50 * Renderable array expected by renderer service. 51 */ 52 public function pageVary(Request $request) { changed this line in version 10 of the diff
added 18 commits
-
774eba14...bc0b5a19 - 17 commits from branch
project:11.x
- 5df55436 - Merge branch drupal:11.x into 2430335-browser-language-detection
-
774eba14...bc0b5a19 - 17 commits from branch
added 1 commit
added 1 commit
48 48 protected $responsePolicy; 49 49 50 50 /** 51 * The cache ID for the (master) request. 51 * The cache IDs for the (main) request. 52 52 * 53 * @var string 53 * @var string[] 54 54 */ 55 protected $cid; 55 protected $cids; - Edited by Andrey Postnikov
changed this line in version 13 of the diff
50 50 /** 51 * The cache ID for the (master) request. 51 * The cache IDs for the (main) request. 52 52 * 53 * @var string 53 * @var string[] 54 54 */ 55 protected $cid; 55 protected $cids; 56 57 /** 58 * The request used for generating the cache ID. 59 * 60 * @var \Symfony\Component\HttpFoundation\Request 61 */ 62 protected $requestUsedForCid; changed this line in version 14 of the diff
added 1 commit
Please register or sign in to reply