function CommandLineOrUnsafeMethod::check
Same name in other branches
- 9 core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod::check()
- 8.9.x core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod::check()
- 10 core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php \Drupal\Core\PageCache\RequestPolicy\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\RequestPolicyCode
public function check(Request $request) {
if ($this->isCli() || !$request->isMethodCacheable()) {
return static::DENY;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.