Version 1
[yaffs-website] / web / core / lib / Drupal / Core / PageCache / ResponsePolicy / NoServerError.php
1 <?php
2
3 namespace Drupal\Core\PageCache\ResponsePolicy;
4
5 use Drupal\Core\PageCache\ResponsePolicyInterface;
6 use Symfony\Component\HttpFoundation\Request;
7 use Symfony\Component\HttpFoundation\Response;
8
9 /**
10  * A policy denying caching of a server error (HTTP 5xx) responses.
11  */
12 class NoServerError implements ResponsePolicyInterface {
13
14   /**
15    * {@inheritdoc}
16    */
17   public function check(Response $response, Request $request) {
18     if ($response->isServerError()) {
19       return static::DENY;
20     }
21   }
22
23 }