Skip to content

Commit

Permalink
fix(module:upload): remove inline style to resolve CSP issue (#8064)
Browse files Browse the repository at this point in the history
This commit addresses the CSP issue by removing the inline `style` property from the
`input` element within the `nz-upload` component. The use of inline style attributes necessitates
the inclusion of `unsafe-inline`.
  • Loading branch information
arturovt committed Mar 14, 2024
1 parent f1a4050 commit 1ac84a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion components/upload/upload-btn.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
We explicitly bind `style.display` to avoid using an inline style
attribute property (which is not allowed when CSP `unsafe-inline`
is not specified).
-->
<input
type="file"
#file
Expand All @@ -6,6 +11,6 @@
[attr.directory]="options.directory ? 'directory' : null"
[attr.webkitdirectory]="options.directory ? 'webkitdirectory' : null"
[multiple]="options.multiple"
style="display: none"
[style.display]="'none'"
/>
<ng-content></ng-content>

0 comments on commit 1ac84a8

Please sign in to comment.