Skip to content

Commit 93655ff

Browse files
committed
MAGETWO-52923: Switching to Varnish causes category menu to force HTTPS links
- Update ScopePool cache key to remove schema but keep everything else
1 parent 6eef03c commit 93655ff

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/internal/Magento/Framework/App/Config/ScopePool.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,13 @@ private function getRequest()
9191
public function getScope($scopeType, $scopeCode = null)
9292
{
9393
$scopeCode = $this->_getScopeCode($scopeType, $scopeCode);
94-
// Skip our Magento Scheme detection https and http are in same key space
95-
$baseUrl = $this->getRequest()->getBaseUrl();
96-
$code = $scopeType . '|' . $scopeCode . '|' . $baseUrl;
94+
95+
//Key by url to support dynamic {{base_url}} and port assignments
96+
$host = $this->getRequest()->getServer('HTTP_HOST');
97+
$port = $this->getRequest()->getServer('SERVER_PORT');
98+
$path = $this->getRequest()->getBasePath();
99+
$urlInfo = $host . $port . trim($path, '/');
100+
$code = $scopeType . '|' . $scopeCode . '|' . $urlInfo;
97101
if (!isset($this->_scopes[$code])) {
98102
$cacheKey = $this->_cacheId . '|' . $code;
99103
$data = $this->_cache->load($cacheKey);

0 commit comments

Comments
 (0)