[SOLVED] TYPO3 12 CSP SourceScheme::data

Hi there,
I’m currently working on the CSP feature of TYPO3. Which is quite cool in my opinion.
But I run into an error I can’t fix and need your help.

I’m using a PHP file
(my_theme/Configuration/ContentSecurityPolicies.php)

I need to add Source Scheme for data, because in my console I get the following error for CSP
Content-Security-Policy: (Report-Only Rule) The settings of the page would block the loading of a resource (font-src) on data:application/font-woff;charset=utf-8… because it violates the following directive : "default-src 'self'"

So I added

new Mutation(
  MutationMode::Append,
  Directive::FontSrc,
  SourceScheme::data,
),

by adding this I get a

### (1/1) Error
Class "SourceScheme" not found

in the frontend.

Any ideas, how can I add a SourceScheme::data within the ContentSecurityPolicies.php?

Thanks in advance
Kind regards
Markus

Have you imported the namespace? It is TYPO3\CMS\Core\Security\ContentSecurityPolicy\SourceSchema.

Ahhhrg Sorry. sometimes I am tooo blind :slight_smile:

Yes needed to add
use TYPO3\CMS\Core\Security\ContentSecurityPolicy\SourceScheme;

and also needed to add

new Mutation(
   MutationMode::Set,
   Directive::FontSrc,
   SourceKeyword::self,
),

new Mutation(
   MutationMode::Append,
   Directive::FontSrc,
   SourceScheme::data,
),

Thanks for your help.
Kind regards
Markus