You are here

function acquia_search_extract_hmac in Acquia Connector 7

Same name and namespace in other branches
  1. 7.3 acquia_search/acquia_search.module \acquia_search_extract_hmac()
  2. 7.2 acquia_search/acquia_search.module \acquia_search_extract_hmac()

Look in the headers and get the hmac_digest out

Return value

string hmac_digest

1 call to acquia_search_extract_hmac()
AcquiaSearchService::authenticateResponse in acquia_search/Acquia_Search_Service.php
Validate the hmac for the response body.

File

acquia_search/acquia_search.module, line 329
Integration between Acquia Drupal and Acquia's hosted solr search service.

Code

function acquia_search_extract_hmac($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 '';
}