From cef2c0f1972bf48136031889d10af6cd0e15b9e5 Mon Sep 17 00:00:00 2001 From: Domagoj Potkoc Date: Wed, 20 Apr 2022 14:24:26 +0200 Subject: [PATCH] improvment for #503 --- Controller/Adminhtml/FastlyCdn/Vcl/Upload.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Controller/Adminhtml/FastlyCdn/Vcl/Upload.php b/Controller/Adminhtml/FastlyCdn/Vcl/Upload.php index 4abd5185..3a5edc36 100644 --- a/Controller/Adminhtml/FastlyCdn/Vcl/Upload.php +++ b/Controller/Adminhtml/FastlyCdn/Vcl/Upload.php @@ -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) { @@ -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); + } } } }