csrf_test.routing.yml

Same filename in other branches
  1. 9 core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
  2. 8.9.x core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
  3. 10 core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
1 string reference to YAML keys in csrf_test.routing.yml
CsrfRequestHeaderTest::testRouteAccess in core/modules/system/tests/src/Functional/CsrfRequestHeaderTest.php
Tests access to routes protected by CSRF request header requirements.

File

core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml

View source
  1. # Tests CSRF request header token protection.
  2. csrf_test.protected:
  3. path: csrf/protected
  4. defaults:
  5. _controller: '\Drupal\csrf_test\Controller\TestController::testMethod'
  6. requirements:
  7. _csrf_request_header_token: 'TRUE'
  8. _method: 'POST'
  9. csrf_test.route_with_csrf_token:
  10. path: csrf/protected/route
  11. defaults:
  12. _controller: '\Drupal\csrf_test\Controller\TestController::testMethod'
  13. requirements:
  14. _permission: 'administer site configuration'
  15. _csrf_token: 'TRUE'

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.