You are here

public function Domain301RedirectController::check in Domain 301 Redirect 8

1 string reference to 'Domain301RedirectController::check'
domain_301_redirect.routing.yml in ./domain_301_redirect.routing.yml
domain_301_redirect.routing.yml

File

src/Controller/Domain301RedirectController.php, line 64

Class

Domain301RedirectController
Controller to check that the domain is working.

Namespace

Drupal\domain_301_redirect\Controller

Code

public function check() {
  $response = new CacheableJsonResponse([
    'enabled' => $this->config
      ->get('enabled'),
  ]);
  return $response
    ->addCacheableDependency(CacheableMetadata::createFromRenderArray([
    '#cache' => [
      'max-age' => 0,
      'contexts' => [
        'url.query_args:token',
      ],
      'tags' => [
        'config:domain_301_redirect.settings',
      ],
    ],
  ]));
}