9
9
namespace Magento \UpwardConnector \Plugin \Magento \Framework \App ;
10
10
11
11
use Magento \Framework \App \Config \ScopeConfigInterface ;
12
+ use Magento \Framework \App \Request \Http as Request ;
12
13
use Magento \Framework \App \ObjectManager ;
13
14
use Magento \Store \Model \ScopeInterface ;
14
- use Magento \Upward \Resolver \Proxy ;
15
15
use Magento \UpwardConnector \Api \UpwardPathManagerInterface ;
16
16
17
17
class AreaList
@@ -20,6 +20,11 @@ class AreaList
20
20
21
21
public const UPWARD_ENV_HEADER = 'UPWARD_PHP_PROXY_HEADER ' ;
22
22
23
+ /**
24
+ * @var \Magento\Framework\App\Request\Http
25
+ */
26
+ private $ request ;
27
+
23
28
/**
24
29
* @var ScopeConfigInterface
25
30
*/
@@ -36,13 +41,16 @@ class AreaList
36
41
const UPWARD_CONFIG_PATH_FRONT_NAMES_TO_SKIP = 'web/upward/front_names_to_skip ' ;
37
42
38
43
/**
44
+ * @param Request $httpRequest
39
45
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
40
46
* @param \Magento\UpwardConnector\Api\UpwardPathManagerInterface|null $pathManager
41
47
*/
42
48
public function __construct (
49
+ Request $ httpRequest ,
43
50
ScopeConfigInterface $ scopeConfig ,
44
51
?UpwardPathManagerInterface $ pathManager = null
45
52
) {
53
+ $ this ->request = $ httpRequest ;
46
54
$ this ->scopeConfig = $ scopeConfig ;
47
55
$ this ->pathManager = $ pathManager ?: ObjectManager::getInstance ()->get (UpwardPathManagerInterface::class);
48
56
}
@@ -78,11 +86,10 @@ public function afterGetCodeByFrontName(
78
86
) ?? ''
79
87
);
80
88
81
- $ request = new \Laminas \Http \PhpEnvironment \Request ();
82
89
$ upwardProxyEnv = getenv (self ::UPWARD_ENV_HEADER );
83
90
84
91
/** $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 ) {
86
93
return $ result ;
87
94
}
88
95
0 commit comments