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

Remove query params from stylesheet URLs when adding it to CSP #671

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

wwwillchen
Copy link
Collaborator

@wwwillchen wwwillchen commented Jul 25, 2024

Received a report that Mesop apps are having misconfigured CSP caused by stylesheet URLs.

I've removed query params because: 1) the query component is ignored (see error message below from Chrome) and 2) it can contain separator characters ";" and "," which was causing the CSP to break. As a follow-up, we can escape or raise an exception if any of the CSP inputs contains one of these separator characters.

The source list for Content Security Policy directive 'style-src' contains a source with an invalid path: '/css2?family=Tiny5&display=swap'. The query component, including the '?', will be ignored.

This also addresses the issue in #549.

@wwwillchen wwwillchen merged commit d0d9ad7 into google:main Jul 25, 2024
3 checks passed
@wwwillchen wwwillchen deleted the fix_custom_font_csp branch July 25, 2024 18:16
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