You are here

private function AcquiaSearchSolrService::extractHmac in Acquia Connector 7.3

Extracts HMAC value from headers.

Parameters

array $headers: Headers list.

Return value

string HMAC string.

1 call to AcquiaSearchSolrService::extractHmac()
AcquiaSearchSolrService::authenticateResponse in acquia_search/includes/AcquiaSearchSolrService.php
Makes authentication checks.

File

acquia_search/includes/AcquiaSearchSolrService.php, line 249

Class

AcquiaSearchSolrService
Class AcquiaSearchSolrService.

Code

private function extractHmac(array $headers) {
  $reg = [];
  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 '';
}