Skip to content

Commit 35a351a

Browse files
authored
Update README.md (#162)
Add missing imports and change variable in readme
1 parent d8e7261 commit 35a351a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,9 @@ You can allow fetching scripts from `www.google.com` by writing a custom preset.
284284
namespace App\Support;
285285

286286
use Spatie\Csp\Directive;
287+
use Spatie\Csp\Keyword;
287288
use Spatie\Csp\Policy;
289+
use Spatie\Csp\Preset;
288290

289291
class MyCspPreset implements Preset
290292
{
@@ -313,7 +315,7 @@ First you must add the nonce to the right directives in your policy:
313315
```php
314316
public function configure(Policy $policy): void
315317
{
316-
$this
318+
$policy
317319
->add(Directive::SCRIPT, 'self')
318320
->add(Directive::STYLE, 'self')
319321
->addNonce(Directive::SCRIPT)

0 commit comments

Comments
 (0)