Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpgradeInsecure.php
Go to the documentation of this file.
1 <?php
2 /***
3  * Copyright © Magento, Inc. All rights reserved.
4  * See COPYING.txt for license details.
5  */
6 
8 
9 use \Magento\Store\Model\Store;
10 
15 {
21  protected $headerName = 'Content-Security-Policy';
22 
28  protected $headerValue = 'upgrade-insecure-requests';
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_UPGRADE_INSECURE);
51  }
52 }
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
const XML_PATH_ENABLE_UPGRADE_INSECURE
Definition: Store.php:76
const XML_PATH_SECURE_IN_FRONTEND
Definition: Store.php:70
const XML_PATH_SECURE_IN_ADMINHTML
Definition: Store.php:72