Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / modules / test_page_test / src / Controller / Test.php
index 2de84e959361a1ad71d94b61622890384416ac33..e754eaf0c2518bb1da0f34f2a7477e24ef92ce0e 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 
 namespace Drupal\test_page_test\Controller;
+
+use Drupal\Core\Url;
+use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpKernel\Exception\HttpException;
 
 /**
@@ -108,4 +111,16 @@ class Test {
     return ['#markup' => '<a href="http://example.com">foo|bar|baz</a>'];
   }
 
+  /**
+   * Loads a page that does a redirect.
+   *
+   * Drupal uses Symfony's RedirectResponse for generating redirects. That class
+   * uses a lower-case 'http-equiv="refresh"'.
+   *
+   * @see \Symfony\Component\HttpFoundation\RedirectResponse
+   */
+  public function metaRefresh() {
+    return new RedirectResponse(Url::fromRoute('test_page_test.test_page', [], ['absolute' => TRUE])->toString(), 302);
+  }
+
 }