private function addValue($classKey, $value) { if ($this->verifier->canApply("allow." . $classKey)) { $keyClass = __NAMESPACE__ . '\\Values\\CSP' . ucfirst($classKey); $valuesInst = new $keyClass($this); $valuesInst->setValues($value)->generate(); $this->data[] = $valuesInst; } }
/** * */ public function getRequestDirectives() { if ($this->verifier->canApply('xss')) { $xss = (array) Arrays::getRecursive($this->config, 'xss'); if (!empty($xss)) { $con = new ContentSecurityPolicy($xss); $con->setVerifier($this->verifier); $con->setComponent('xss'); $con->execute(); $response = $this->serviceLocator->get('Response'); $response->getHeaders()->addHeader($con); } } if (array_key_exists('cross-origin', $this->config)) { $cors = new Cors($this->serviceLocator); } }