Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use fill attribute instead of inline styles #4

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

iliana
Copy link
Contributor

@iliana iliana commented Apr 12, 2024

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
Copy link
Contributor

@david-crespo david-crespo left a comment

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