You are here

function acquia_search_extract_hmac in Acquia Search 6.3

Same name and namespace in other branches
  1. 6 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_Service.php
Validate the hmac for the response body.

File

./acquia_search.module, line 434
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 '';
}