Skip to content

use fill attribute instead of inline styles#4

Merged
david-crespo merged 1 commit into
mainfrom
iliana/fill
Apr 12, 2024
Merged

use fill attribute instead of inline styles#4
david-crespo merged 1 commit into
mainfrom
iliana/fill

Conversation

@iliana

@iliana iliana commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

While working on oxidecomputer/console#2142 I ran into content-security-policy violations due to inline styles. After finding out that React applies styles using the style attribute in a way that's compatible with CSP I tried to figure out what the violations were; it turns out all of them were due to the style= attribute in the SVG generated by this library.

Using fill directly allows use of a stricter content-security-policy that does not require allowing style-src: 'unsafe-inline'.

(Tested by hand-patching node_modules/@oxide/identicon/dist/identicon.js in my console environment.)

@iliana iliana requested a review from david-crespo April 12, 2024 21:07

@david-crespo david-crespo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woohoo

@david-crespo david-crespo merged commit 78fae12 into main Apr 12, 2024
@david-crespo david-crespo deleted the iliana/fill branch April 12, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants