![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-csp/Model/Collector/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Csp\Model\Collector; use Magento\Csp\Api\CspAwareActionInterface; use Magento\Csp\Api\PolicyCollectorInterface; /** * Asks for route-specific policies from a compatible controller. */ class ControllerCollector implements PolicyCollectorInterface { /** * @var CspAwareActionInterface|null */ private $controller; /** * Set the action interface that is responsible for processing current HTTP request. * * @param CspAwareActionInterface $cspAwareAction * @return void */ public function setCurrentActionInstance(CspAwareActionInterface $cspAwareAction): void { $this->controller = $cspAwareAction; } /** * @inheritDoc */ public function collect(array $defaultPolicies = []): array { if ($this->controller) { return $this->controller->modifyCsp($defaultPolicies); } return $defaultPolicies; } }