Skip to content

Commit 9d70b12

Browse files
Feat: added Alchemer survey preset (#191)
* Feat: added Alchemer survey preset * preset added to test * feat: add Alchemer CSP preset snapshot --------- Co-authored-by: Freek Van der Herten <freek@spatie.be>
1 parent d4b6095 commit 9d70b12

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ This package ships with a few commonly used presets to get your started. *We're
157157
|----------------------------|---------------------------------------------------------------------------------------|
158158
| `Basic` | Allow requests to scripts, images… within the application |
159159
| `AdobeFonts` | [fonts.adobe.com](https://fonts.adobe.com) (previously typekit.com) |
160+
| `Alchemer Survey` | [alchemer.com](https://www.alchemer.com) |
160161
| `Algolia` | [algolia.com](https://www.algolia.com) |
161162
| `Bootstrap` | [getbootstrap.com](https://getbootstrap.com) |
162163
| `Bunny Fonts` | [fonts.bunny.net](https://fonts.bunny.net/) |

src/Presets/Alchemer.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Spatie\Csp\Presets;
4+
5+
use Spatie\Csp\Directive;
6+
use Spatie\Csp\Policy;
7+
use Spatie\Csp\Preset;
8+
9+
class Alchemer implements Preset
10+
{
11+
public function configure(Policy $policy): void
12+
{
13+
$policy
14+
->add(Directive::FRAME, ['survey.alchemer.com']);
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frame-src survey.alchemer.com

tests/PresetTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function (string $presetClass): void {
2121
)->with([
2222
Presets\Basic::class,
2323
Presets\AdobeFonts::class,
24+
Presets\Alchemer::class,
2425
Presets\Algolia::class,
2526
Presets\BunnyFonts::class,
2627
Presets\Bootstrap::class,

0 commit comments

Comments
 (0)