public function SearchSubscriber::extractHmac in Acquia Search 2.x
Same name and namespace in other branches
- 3.x src/EventSubscriber/SearchSubscriber.php \Drupal\acquia_search\EventSubscriber\SearchSubscriber::extractHmac()
Look in the headers and get the hmac_digest out.
Parameters
mixed $headers: Headers array.
Return value
string Hmac_digest or empty string.
1 call to SearchSubscriber::extractHmac()
- SearchSubscriber::authenticateResponse in src/
EventSubscriber/ SearchSubscriber.php - Validate the hmac for the response body.
File
- src/
EventSubscriber/ SearchSubscriber.php, line 155
Class
- SearchSubscriber
- Extends Solarium plugin: authenticate, etc.
Namespace
Drupal\acquia_search\EventSubscriberCode
public function extractHmac($headers) {
$reg = [];
if (is_array($headers)) {
foreach ($headers as $value) {
if (stristr($value, 'pragma') && preg_match("/hmac_digest=([^;]+);/i", $value, $reg)) {
return trim($reg[1]);
}
}
}
return '';
}