ant-design / ant-design-icons

⭐ Ant Design SVG Icons
https://ant.design/components/icon/
MIT License
939 stars 577 forks source link

[Angular] Allow usage with trusted types #614

Closed timonmasberg closed 5 months ago

timonmasberg commented 5 months ago

Currently, when using CSP with trusted types, an error will be thrown, since the IconService uses innerHTML. I propose a function for optional registering of a trusted policy to allow using trusted types.

timonmasberg commented 5 months ago

you can utilize the default policy for this

acomito commented 4 months ago

@timonmasberg Can you clarify? You set require-trusted-types-for to default?

timonmasberg commented 4 months ago

require-trusted-types-for to default?

No, you can create a policy for "default", which allows you to sanitize the innerHTML calls from the IconService.