protected function isHttpOriginIsInTheWhiteList()
{
$checked = false;
foreach ($this->config as $domain) {
$originDomainArray = explode('.', parse_url($this->getDI()->getRequest()->getHeader('HTTP_ORIGIN'), PHP_URL_HOST));
$allowedDomainArray = explode('.', $domain['domain']);
if (!(count($allowedDomainArray) > count($originDomainArray)) && !array_diff($allowedDomainArray, $originDomainArray)) {
$checked = true;
}
}
return $checked;
}