Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CommandLineOrUnsafeMethod.php

function CommandLineOrUnsafeMethod::check

Overrides RequestPolicyInterface::check

File

core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php, line 20

Class

CommandLineOrUnsafeMethod
Reject when running from the command line or when HTTP method is not safe.

Namespace

Drupal\Core\PageCache\RequestPolicy

Code

public function check(Request $request) {
    if ($this->isCli() || !$request->isMethodCacheable()) {
        return static::DENY;
    }
}
RSS feed
Powered by Drupal