mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Renaming ContentSecurityPolicyConfig file
This commit is contained in:
parent
230bf537e5
commit
dc0847473b
@ -170,7 +170,7 @@ class App extends BaseConfig
|
||||
| Enables the Response's Content Secure Policy to restrict the sources that
|
||||
| can be used for images, scripts, CSS files, audio, video, etc. If enabled,
|
||||
| the Response object will populate default values for the policy from the
|
||||
| ContentSecurityPolicyConfig.php file. Controllers can always add to those
|
||||
| ContentSecurityPolicy.php file. Controllers can always add to those
|
||||
| restrictions at run time.
|
||||
|
|
||||
| For a better understanding of CSP, see these documents:
|
||||
|
@ -11,7 +11,7 @@ use CodeIgniter\Config\BaseConfig;
|
||||
*
|
||||
* @package App\Config
|
||||
*/
|
||||
class ContentSecurityPolicyConfig extends BaseConfig
|
||||
class ContentSecurityPolicy extends BaseConfig
|
||||
{
|
||||
public $reportOnly = false;
|
||||
|
@ -36,7 +36,7 @@
|
||||
* @filesource
|
||||
*/
|
||||
|
||||
use App\Config\ContentSecurityPolicyConfig;
|
||||
use App\Config\ContentSecurityPolicy;
|
||||
|
||||
/**
|
||||
* Class ContentSecurityPolicy
|
||||
@ -97,9 +97,9 @@ class ContentSecurityPolicy
|
||||
*
|
||||
* Stores our default values from the config file.
|
||||
*
|
||||
* @param ContentSecurityPolicyConfig $config
|
||||
* @param ContentSecurityPolicy $config
|
||||
*/
|
||||
public function __construct(ContentSecurityPolicyConfig $config)
|
||||
public function __construct(ContentSecurityPolicy $config)
|
||||
{
|
||||
foreach ($config as $setting => $value)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
use App\Config\App;
|
||||
use App\Config\ContentSecurityPolicyConfig;
|
||||
use App\Config\ContentSecurityPolicy;
|
||||
|
||||
/**
|
||||
* Representation of an outgoing, getServer-side response.
|
||||
@ -164,7 +164,7 @@ class Response extends Message implements ResponseInterface
|
||||
// Are we enforcing a Content Security Policy?
|
||||
if ($config->CSPEnabled === true)
|
||||
{
|
||||
$this->CSP = new ContentSecurityPolicy(new ContentSecurityPolicyConfig());
|
||||
$this->CSP = new ContentSecurityPolicy(new ContentSecurityPolicy());
|
||||
$this->CSPEnabled = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user