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

Breadcrumb

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

function Response::getVary

Returns an array of header names given in the Vary header.

@final

File

vendor/symfony/http-foundation/Response.php, line 1072

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function getVary() : array {
    if (!($vary = $this->headers
        ->all('Vary'))) {
        return [];
    }
    $ret = [];
    foreach ($vary as $item) {
        $ret[] = preg_split('/[\\s,]+/', $item);
    }
    return array_merge([], ...$ret);
}
RSS feed
Powered by Drupal