Skip to content

Commit ca84f7a

Browse files
authored
Feat: add SurveyMonkey preset (#196)
1 parent c423bea commit ca84f7a

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +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) |
160+
| `Alchemer Survey` | [alchemer.com](https://www.alchemer.com) |
161161
| `Algolia` | [algolia.com](https://www.algolia.com) |
162162
| `Bootstrap` | [getbootstrap.com](https://getbootstrap.com) |
163163
| `Bunny Fonts` | [fonts.bunny.net](https://fonts.bunny.net/) |
@@ -185,6 +185,7 @@ This package ships with a few commonly used presets to get your started. *We're
185185
| `Posthog` | [posthog.com](https://posthog.com/) |
186186
| `Sentry` | [sentry.io](https://sentry.io/) |
187187
| `Stripe` | [stripe.com](https://stripe.com/) |
188+
| `SurveyMonkey` | [surveymonkey.com](https://www.surveymonkey.com/) |
188189
| `TicketTailor` | [tickettailor.com](https://www.tickettailor.com) |
189190
| `Tolt` | [tolt.io](https://tolt.io) |
190191
| `Vimeo` | [vimeo.com](https://vimeo.com) |

src/Presets/SurveyMonkey.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 SurveyMonkey implements Preset
10+
{
11+
public function configure(Policy $policy): void
12+
{
13+
$policy
14+
->add(Directive::FRAME, ['https://www.surveymonkey.com']);
15+
}
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
frame-src https://www.surveymonkey.com

tests/PresetTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function (string $presetClass): void {
5050
Presets\Posthog::class,
5151
Presets\Sentry::class,
5252
Presets\Stripe::class,
53+
Presets\SurveyMonkey::class,
5354
Presets\TicketTailor::class,
5455
Presets\Tolt::class,
5556
Presets\Vimeo::class,

0 commit comments

Comments
 (0)