Skip to content

Commit 6c30d74

Browse files
Merge branch 'master' into release
2 parents cc95795 + 2477f2c commit 6c30d74

File tree

12 files changed

+59
-14
lines changed

12 files changed

+59
-14
lines changed

Controller/Adminhtml/FastlyCdn/Blocking/Blocking.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function execute()
174174
return $result->setData([
175175
'status' => true
176176
]);
177-
} catch (\Exception $e) {
177+
} catch (\Throwable $e) {
178178
return $result->setData([
179179
'status' => false,
180180
'msg' => $e->getMessage()

Controller/Adminhtml/FastlyCdn/Edge/Dictionary/ListAll.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class ListAll extends Action
3535
{
3636
const ADMIN_RESOURCE = 'Magento_Config::config';
3737

38+
const NGWAF_DICTIONARY_NAME = "Edge_Security";
39+
3840
/**
3941
* @var Http
4042
*/
@@ -96,6 +98,14 @@ public function execute()
9698
]);
9799
}
98100

101+
// This dictionary represents NGWAF, used while migrating customers from WAF. Adobe is requesting that
102+
// their customers shouldn't be able to disable it, so we remove it from Admin listing.
103+
foreach ($dictionaries as $key => $dictionary) {
104+
if (isset($dictionary->name) && $dictionary->name === self::NGWAF_DICTIONARY_NAME) {
105+
array_splice($dictionaries, $key, 1);
106+
}
107+
}
108+
99109
return $result->setData([
100110
'status' => true,
101111
'dictionaries' => $dictionaries

Model/Layout/LayoutPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function afterGenerateElements(\Magento\Framework\View\Layout $subject):
9898
public function afterGetOutput(\Magento\Framework\View\Layout $subject, $result) // @codingStandardsIgnoreLine - unused parameter
9999
{
100100
if ($this->config->getType() === Config::FASTLY) {
101-
$this->response->setHeader("Fastly-Module-Enabled", "1.2.220", true);
101+
$this->response->setHeader("Fastly-Module-Enabled", "1.2.221", true);
102102
}
103103

104104
return $result;

Observer/InvalidateVarnishObserver.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ public function execute(\Magento\Framework\Event\Observer $observer): void
8181
continue;
8282
}
8383
$tag = $this->cacheTags->convertCacheTags($tag);
84+
85+
if (!$this->isTagAllowed($tag)) {
86+
continue;
87+
}
88+
8489
if (!in_array($tag, $this->alreadyPurged)) {
8590
$tags[] = $tag;
8691
$this->alreadyPurged[] = $tag;
@@ -113,4 +118,24 @@ private function canPurgeObject(\Magento\Framework\DataObject\IdentityInterface
113118
}
114119
return true;
115120
}
121+
122+
/**
123+
* Additional validation since IdentityInterface can pass canPurgeObject check (e.g. ProductRuleIndexer), but still
124+
* hold tags of products or categories
125+
*
126+
* @param string $tag
127+
* @return bool
128+
*/
129+
private function isTagAllowed(string $tag)
130+
{
131+
if ($tag === \Magento\Catalog\Model\Category::CACHE_TAG && !$this->config->canPurgeCatalogCategory()) {
132+
return false;
133+
}
134+
135+
if ($tag === \Magento\Catalog\Model\Product::CACHE_TAG && !$this->config->canPurgeCatalogProduct()) {
136+
return false;
137+
}
138+
139+
return true;
140+
}
116141
}

Release-Notes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Fastly_Cdn Release Notes
22

3+
## 1.2.221
4+
5+
- Catch Throwable instead of Exception in Blocking controller https://github.com/fastly/fastly-magento2/pull/704
6+
- Perform additional validation during tag purge https://github.com/fastly/fastly-magento2/pull/705
7+
- Trigger init of edge modules if tab is open by default https://github.com/fastly/fastly-magento2/pull/707
8+
- Don't display NGWAF dictionary in admin screen https://github.com/fastly/fastly-magento2/pull/710
9+
310
## 1.2.220
411

512
- Logging endpoints changes https://github.com/fastly/fastly-magento2/pull/701

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.220
1+
1.2.221

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"zordius/lightncandy": "^1.2"
1313
},
1414
"type": "magento2-module",
15-
"version": "1.2.220",
15+
"version": "1.2.221",
1616
"license": "BSD-3-Clause",
1717
"autoload": {
1818
"files": [ "registration.php" ],

etc/vcl_snippets/deliver.vcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
# Add an easy way to see whether custom Fastly VCL has been uploaded
4141
if ( req.http.Fastly-Debug ) {
42-
set resp.http.Fastly-Magento-VCL-Uploaded = "1.2.220";
42+
set resp.http.Fastly-Magento-VCL-Uploaded = "1.2.221";
4343
if (table.lookup(magentomodule_config, "allow_super_users_during_maint", "0") == "1") {
4444
set resp.http.Fastly-Magento-Maintenance-Mode = "on";
4545
}

etc/vcl_snippets/miss.vcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
unset bereq.http.Accept-Encoding;
44

55
# Send VCL version uploaded to the backend
6-
set bereq.http.Fastly-Magento-VCL-Uploaded = "1.2.220";
6+
set bereq.http.Fastly-Magento-VCL-Uploaded = "1.2.221";

etc/vcl_snippets/pass.vcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
}
1313

1414
# Send VCL version uploaded to the backend
15-
set bereq.http.Fastly-Magento-VCL-Uploaded = "1.2.220";
15+
set bereq.http.Fastly-Magento-VCL-Uploaded = "1.2.221";

0 commit comments

Comments
 (0)