99namespace Magento \UpwardConnector \Plugin \Magento \Framework \App ;
1010
1111use Magento \Framework \App \Config \ScopeConfigInterface ;
12+ use Magento \Framework \App \Request \Http as Request ;
1213use Magento \Framework \App \ObjectManager ;
1314use Magento \Store \Model \ScopeInterface ;
14- use Magento \Upward \Resolver \Proxy ;
1515use Magento \UpwardConnector \Api \UpwardPathManagerInterface ;
1616
1717class AreaList
@@ -20,6 +20,11 @@ class AreaList
2020
2121 public const UPWARD_ENV_HEADER = 'UPWARD_PHP_PROXY_HEADER ' ;
2222
23+ /**
24+ * @var \Magento\Framework\App\Request\Http
25+ */
26+ private $ request ;
27+
2328 /**
2429 * @var ScopeConfigInterface
2530 */
@@ -36,13 +41,16 @@ class AreaList
3641 const UPWARD_CONFIG_PATH_FRONT_NAMES_TO_SKIP = 'web/upward/front_names_to_skip ' ;
3742
3843 /**
44+ * @param Request $httpRequest
3945 * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
4046 * @param \Magento\UpwardConnector\Api\UpwardPathManagerInterface|null $pathManager
4147 */
4248 public function __construct (
49+ Request $ httpRequest ,
4350 ScopeConfigInterface $ scopeConfig ,
4451 ?UpwardPathManagerInterface $ pathManager = null
4552 ) {
53+ $ this ->request = $ httpRequest ;
4654 $ this ->scopeConfig = $ scopeConfig ;
4755 $ this ->pathManager = $ pathManager ?: ObjectManager::getInstance ()->get (UpwardPathManagerInterface::class);
4856 }
@@ -78,11 +86,10 @@ public function afterGetCodeByFrontName(
7886 ) ?? ''
7987 );
8088
81- $ request = new \Laminas \Http \PhpEnvironment \Request ();
8289 $ upwardProxyEnv = getenv (self ::UPWARD_ENV_HEADER );
8390
8491 /** $upwardProxyEnv needs to be truthy because getenv returns "false" if it didn't find it */
85- if ($ upwardProxyEnv && $ request ->getHeader (self ::UPWARD_HEADER ) === $ upwardProxyEnv ) {
92+ if ($ upwardProxyEnv && $ this -> request ->getHeader (self ::UPWARD_HEADER ) === $ upwardProxyEnv ) {
8693 return $ result ;
8794 }
8895
0 commit comments