Skip to content

Commit

Permalink
Merge pull request #155 from shochdoerfer/fix/varnish_esi_urls
Browse files Browse the repository at this point in the history
Add varnish ESI url to whitelist
  • Loading branch information
shochdoerfer committed Apr 13, 2019
2 parents 0116755 + e78797b commit 0f5419e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
$this->runUpgrade302($setup);
}

if (version_compare($context->getVersion(), '3.0.4', '<')) {
$this->runUpgrade304($setup);
}

$setup->endSetup();
}

Expand Down Expand Up @@ -233,4 +237,23 @@ private function runUpgrade302(ModuleDataSetupInterface $setup)
$whitelistEntries
);
}

/**
* @param ModuleDataSetupInterface $setup
*/
private function runUpgrade304(ModuleDataSetupInterface $setup)
{
$whitelistEntries = [
$this->getWhitelistEntryAsArray(
0,
'Varnish ESI url',
'/page_cache/block/esi/blocks'
),
];

$setup->getConnection()->insertMultiple(
$setup->getTable('bitexpert_forcelogin_whitelist'),
$whitelistEntries
);
}
}
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="BitExpert_ForceCustomerLogin" setup_version="3.0.3">
<module name="BitExpert_ForceCustomerLogin" setup_version="3.0.4">
<sequence>
<module name="Magento_Customer"/>
</sequence>
Expand Down

0 comments on commit 0f5419e

Please sign in to comment.