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

Inline HTML styles conflict with Content Security Policy #99

Open
Melebius opened this issue Jan 18, 2024 · 0 comments
Open

Inline HTML styles conflict with Content Security Policy #99

Melebius opened this issue Jan 18, 2024 · 0 comments

Comments

@Melebius
Copy link

  • HtmlTestRunner version: 1.2.1
  • Python version: 3.8.10
  • Operating System: Ubuntu 20.04.6 LTS

Description

We use HtmlTestRunner for tests that are run on a Jenkins server. The HTML reports can be viewed in Jenkins but the stylesheets do not load, resulting in poorly rendered reports.

The Content Security Policy of Jenkins does not allow inline HTML styles. This can be worked around using the unsafe-inline keyword but the documentation recommends: “avoid using the unsafe-inline keyword in your CSP policy”.

I guess this could be solved with a CSP hash of the style if all the styles appearing in reports were defined in one <style> block and then referred to using attributes like class or id.

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

No branches or pull requests

1 participant