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

CSP nonce support for lazy functions #593

Open
pete-murphy opened this issue Oct 28, 2024 · 0 comments · May be fixed by #594
Open

CSP nonce support for lazy functions #593

pete-murphy opened this issue Oct 28, 2024 · 0 comments · May be fixed by #594

Comments

@pete-murphy
Copy link

pete-murphy commented Oct 28, 2024

See this comment.

We're trying to add nonces to elm-css-generated <style> tags, and are running into an issue that is not resolved by #570.

We're using elm-form's Form.renderStyledHtml, which calls Html.Styled.Lazy.lazy4, which calls VirtualDom.Styled.lazy4, which calls VirtualDom.Styled.toUnstyled.

We need to use toNonceUnstyled to pass the nonce of course, but there's no way to do this currently even if Form.renderStyledHtml took an optional nonce: it uses Html.Styled.Lazy which does not expose any way of passing the nonce through to the VirtualDom.Styled internals.

Unless I'm missing something, I think for CSP nonce support we would need to add Html.Styled.lazy* and VirtualDom.Styled.lazy* variants that take a nonce as argument (and call toNonceUnstyled internally).

pete-murphy added a commit to pete-murphy/elm-css that referenced this issue Oct 28, 2024
@pete-murphy pete-murphy linked a pull request Oct 28, 2024 that will close this issue
pete-murphy added a commit to pete-murphy/elm-css that referenced this issue Oct 28, 2024
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 a pull request may close this issue.

1 participant