You are here

protected function JsonPathReplacer::getContentId in Subrequests 8.2

Same name and namespace in other branches
  1. 3.x src/JsonPathReplacer.php \Drupal\subrequests\JsonPathReplacer::getContentId()

Gets the clean Content ID for a response.

Removes all the derived indicators and the surrounding angles.

@returns string The content ID.

Parameters

\Symfony\Component\HttpFoundation\Response $response: The response to extract the Content ID from.

1 call to JsonPathReplacer::getContentId()
JsonPathReplacer::extractTokenReplacements in src/JsonPathReplacer.php
Extracts the token replacements for a given subrequest.

File

src/JsonPathReplacer.php, line 314

Class

JsonPathReplacer

Namespace

Drupal\subrequests

Code

protected function getContentId(Response $response) {
  $header = $response->headers
    ->get('Content-ID', '');
  return substr($header, 1, strlen($header) - 2);
}