Skip to content

Commit

Permalink
Add hotjar font CSP domain
Browse files Browse the repository at this point in the history
  • Loading branch information
zapotocnylubos committed Oct 2, 2024
1 parent 42a3053 commit daca37a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions webapp/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ services:
scriptSrc: "'self' 'unsafe-inline' https://*.googletagmanager.com https://*.hotjar.com https://*.hotjar.io wss://*.hotjar.com"
imgSrc: "'self' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.g.doubleclick.net https://*.google.com data: https://*.hotjar.com https://*.hotjar.io wss://*.hotjar.com"
connectSrc: "'self' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.g.doubleclick.net https://*.google.com https://*.hotjar.com https://*.hotjar.io wss://*.hotjar.com"
fontSrc: "'self' https://*.hotjar.com"
frameAncestors: "'self'"
6 changes: 6 additions & 0 deletions webapp/src/EventListener/AddContentSecurityPolicyListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function __invoke(ResponseEvent $event): void
$this->getScriptSrcCsp(),
$this->getImageSrcCsp(),
$this->getConnectSrcCsp(),
$this->getFontSrcScp(),
$this->getFrameAncestorsCsp()
]);

Expand Down Expand Up @@ -58,6 +59,11 @@ private function getConnectSrcCsp(): string
return "connect-src " . $this->cspConfig['connectSrc'];
}

private function getFontSrcScp(): string
{
return "font-src " . $this->cspConfig['fontSrc'];
}

private function getFrameAncestorsCsp(): string
{
return "frame-ancestors " . $this->cspConfig['frameAncestors'];
Expand Down

0 comments on commit daca37a

Please sign in to comment.