You are here

protected function SearchApiAcquiaSearchConnection::extractHmac in Acquia Search for Search API 7.2

Look in the headers and get the hmac_digest out.

See also

acquia_search_extract_hmac()

1 call to SearchApiAcquiaSearchConnection::extractHmac()
SearchApiAcquiaSearchConnection::authenticateResponse in includes/v2/SearchApiAcquiaSearchConnection.php
Validate the hmac for the response body.

File

includes/v2/SearchApiAcquiaSearchConnection.php, line 135

Class

SearchApiAcquiaSearchConnection
Starting point for the Solr API. Represents a Solr server resource and has methods for pinging, adding, deleting, committing, optimizing and searching.

Code

protected function extractHmac($headers) {
  $reg = array();
  if (is_array($headers)) {
    foreach ($headers as $name => $value) {
      if (strtolower($name) == 'pragma' && preg_match("/hmac_digest=([^;]+);/i", $value, $reg)) {
        return trim($reg[1]);
      }
    }
  }
  return '';
}