- Issue created by @alexpott
- Merge request !12321Issue #3528434: \Drupal\Core\Access\RouteProcessorCsrf does not add the... → (Open) created by annmarysruthy
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
Neat so we've now found that this is causing cache problems. The fail in core/modules/views/tests/src/Functional/Rest/ViewJsonBasicAuthTest.php is a real use-case failure. The header for the response contains links like:
5 => '<http://drupal8alt.test/admin/structure/views/view/test_rest/enable?token=EX9ReP8nZc2j3HZ7giS1uTBhTdjB7c7B5lL-N5dOLwU>; rel="https://drupal.org/link-relations/enable"', 6 => '<http://drupal8alt.test/admin/structure/views/view/test_rest/disable?token=TN1doQ-RJc-1-Q_KCviUdFSolzuAwIVLCfxW5Xvhh4o>; rel="https://drupal.org/link-relations/disable"',
These links are only valid for the user who made the requests session so we should be caching the response. There is a decent question about whether we should have the disable and enable links in the header but if they are there and using CSRF protection then the cache contexts need to be correct.
We need to fix the expected cache context for all the tests listed here: https://git.drupalcode.org/issue/drupal-3528434/-/pipelines/515881/test_...
I suspect these are all the disable-able config entities - not sure where we adding the link relationship atm...