Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Hsts.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Store\Model\Store;
10 
15 {
21  protected $headerName = 'Strict-Transport-Security';
22 
28  protected $headerValue = 'max-age=31536000';
29 
33  protected $scopeConfig;
34 
39  {
40  $this->scopeConfig = $scopeConfig;
41  }
42 
46  public function canApply()
47  {
48  return (bool)$this->scopeConfig->isSetFlag(Store::XML_PATH_SECURE_IN_FRONTEND)
49  && $this->scopeConfig->isSetFlag(Store::XML_PATH_SECURE_IN_ADMINHTML)
50  && $this->scopeConfig->isSetFlag(Store::XML_PATH_ENABLE_HSTS);
51  }
52 }
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
Definition: Hsts.php:38
const XML_PATH_SECURE_IN_FRONTEND
Definition: Store.php:70
const XML_PATH_SECURE_IN_ADMINHTML
Definition: Store.php:72