Skip to content

Commit cc61e88

Browse files
committed
ACP2E-3447: Using the wrong Store ID in GraphQL header causes fatal memory error
1 parent 0bb5a64 commit cc61e88

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/code/Magento/Store/App/Request/StorePathInfoValidator.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\App\Request\Http;
1313
use Magento\Framework\App\Request\PathInfo;
1414
use Magento\Framework\Exception\NoSuchEntityException;
15+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1516
use Magento\Store\Api\StoreRepositoryInterface;
1617
use Magento\Store\Model\Store;
1718
use Magento\Store\Model\StoreIsInactiveException;
@@ -20,7 +21,7 @@
2021
/**
2122
* Gets the store from the path if valid
2223
*/
23-
class StorePathInfoValidator
24+
class StorePathInfoValidator implements ResetAfterRequestInterface
2425
{
2526
/**
2627
* Store Config
@@ -119,4 +120,12 @@ private function getStoreCode(string $pathInfo) : string
119120
$pathParts = explode('/', ltrim($pathInfo, '/'), 2);
120121
return current($pathParts);
121122
}
123+
124+
/**
125+
* @inheritDoc
126+
*/
127+
public function _resetState(): void
128+
{
129+
$this->validatedStoreCodes = [];
130+
}
122131
}

0 commit comments

Comments
 (0)