CakePHP Cookbook Documentation 5.xicy headers in your application. Before using it you should install paragonie/csp-builder: composer require paragonie/csp-builder You can then configure the middleware using an array, or passing in a a built CSPBuilder object: use Cake\Http\Middleware\CspMiddleware; $csp = new CspMiddleware([ 'script-src' => [ 'allow' => [ 'https://www.google-analytics.com', ], $middlewareQueue->add($csp); If you want to use a more strict CSP configuration, you can enable nonce based CSP rules with the scriptNonce and styleNonce options. When enabled these options will modify your CSP policy0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook Documentation 5.xicy headers in your application. Before using it you should install paragonie/csp-builder: composer require paragonie/csp-builder You can then configure the middleware using an array, or passing in a a built CSPBuilder object: use Cake\Http\Middleware\CspMiddleware; $csp = new CspMiddleware([ 'script-src' => [ (continues on next page) 660 Chapter 27. Security CakePHP Cookbook Documentation, Release $middlewareQueue->add($csp); If you want to use a more strict CSP configuration, you can enable nonce based CSP rules with the scriptNonce and styleNonce options. When enabled these options will modify your CSP policy0 码力 | 848 页 | 2.53 MB | 1 年前3
CakePHP Cookbook 4.x
icy headers in your application. Before using it you should install paragonie/csp-builder: composer require paragonie/csp-builder You can then configure the middleware using an array, or passing in a a built CSPBuilder object: use Cake\Http\Middleware\CspMiddleware; $csp = new CspMiddleware([ 'script-src' => [ 'allow' => [ 'https://www.google-analytics.com', ], $middlewareQueue->add($csp); If you want to use a more strict CSP configuration, you can enable nonce based CSP rules with the scriptNonce and styleNonce options. When enabled these options will modify your CSP policy0 码力 | 1249 页 | 1.04 MB | 1 年前3
CakePHP Cookbook 4.x
icy headers in your application. Before using it you should install paragonie/csp-builder: composer require paragonie/csp-builder You can then configure the middleware using an array, or passing in a a built CSPBuilder object: use Cake\Http\Middleware\CspMiddleware; $csp = new CspMiddleware([ 'script-src' => [ (continues on next page) 762 Chapter 26. Security CakePHP Cookbook Documentation, Release $middlewareQueue->add($csp); If you want to use a more strict CSP configuration, you can enable nonce based CSP rules with the scriptNonce and styleNonce options. When enabled these options will modify your CSP policy0 码力 | 967 页 | 2.88 MB | 1 年前3
CakePHP Cookbook 3.x
should install paragonie/csp-builder: You can then configure the middleware using an array, or passing in a built CSPBuilder object: use Cake\Http\Middleware\CspMiddleware; $csp = new CspMiddleware([ 'unsafe-inline' => false, 'unsafe-eval' => false, ], ]); $middlewareQueue->add($csp); New in version 3.9.0: CspMiddleware was added. Security Header Middleware The SecurityHeaderMiddleware0 码力 | 1244 页 | 1.05 MB | 1 年前3
共 5 条
- 1













