Skip to content

Commit

Permalink
improvment for fastly#503
Browse files Browse the repository at this point in the history
  • Loading branch information
dpotkoc authored and MickaelDatadome committed Oct 5, 2023
1 parent d8df2b1 commit 6184c35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Controller/Adminhtml/FastlyCdn/Vcl/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public function execute()
$customSnippetPath = $read->getAbsolutePath(Config::CUSTOM_SNIPPET_PATH);
$customSnippets = $this->config->getCustomSnippets($customSnippetPath);
//$customSnippets['recv_200_Proba'] = 'set req.http.proba = "1";';
//$customSnippets['recv_200_Proba2'] = 'set req.http.proba2 = "1";';

$allowedSnippets = [];
foreach ($snippets as $key => $value) {
Expand Down Expand Up @@ -363,7 +364,10 @@ private function syncSnippets(array $allowedSnippets, int $version): void
$snippetsForDelete = array_diff($currentActiveSnippets, $allowedSnippets);

foreach ($snippetsForDelete as $snippetName) {
$this->api->removeSnippet($version, $snippetName);
//remove only snippet name which starts with magento prefix
if (strpos($snippetName, Config::FASTLY_MAGENTO_MODULE . '_') === 0) {
$this->api->removeSnippet($version, $snippetName);
}
}
}
}

0 comments on commit 6184c35

Please sign in to comment.