Version 1
[yaffs-website] / web / core / modules / system / tests / modules / trusted_hosts_test / src / Controller / TrustedHostsTestController.php
diff --git a/web/core/modules/system/tests/modules/trusted_hosts_test/src/Controller/TrustedHostsTestController.php b/web/core/modules/system/tests/modules/trusted_hosts_test/src/Controller/TrustedHostsTestController.php
new file mode 100644 (file)
index 0000000..68c8b64
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace Drupal\trusted_hosts_test\Controller;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Provides a test controller for testing the trusted hosts setting.
+ */
+class TrustedHostsTestController {
+
+  /**
+   * Creates a fake request and prints out its host.
+   */
+  public function fakeRequestHost() {
+    $request = Request::create('/');
+    return ['#markup' => 'Host: ' . $request->getHost()];
+  }
+
+}