Closed fsgmhoward closed 2 years ago
@fsgmhoward Thanks for submitting an issue! This is odd that we are getting the CSP doubling here 🤔 . We recently added our own to follow the best practices Microsoft outlines. https://github.com/ryanluker/vscode-coverage-gutters/pull/290/files#diff-68de02f39c1df4e458757a13079e7dc64684f5f583e5c1300f7fc0f7d5c9af45R38-R47
@ryanluker Sorry for the confusion. I edited the text after I submit the issue. The CSP double is because I wanted to try whether adding CSP manually in the html files will work. The original html file does not have any CSP header and the only one added by VSCode is the none
one.
So something like this:
@fsgmhoward Thanks for the extra insight, I think we can tinker with the policy to have the default src work for self 🤔 . We recently implemented a webview helper to assist with this and it should be a pretty easy change to have the display swapped around https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/extension/webview.ts#L38 .
There might also be ways we can add more to the policy around img-src that might be more correct then modifying the default-src attribute.
Fixed in #363 and will go out in the next release.
Describe the bug I use Jacoco plugin in gradle to generate the coverage report for JUnit tests. Line highlights works fine but when I preview the report, all style are gone and none of the links are clickable. Using dev tools it shows that all resources were blocked by CSP due to the header "default-src: 'none'" added (by VSCode? at least it is not in the
index.html
originally).To Reproduce Steps to reproduce the behaviour:
build.gradle
:"coverage-gutters.coverageReportFileName": "build/jacocoHtml/index.html"
Expected behaviour A preview report being shown with all styles in and links clickable.
Screenshots
Screenshot for report preview (in vscode):
What it should look like in an ordinary browser:
Screenshot of dev tools: (The
default-src: 'self'
is added by me toindex.html
manually but it does not seem to work. The original file generated by Jacoco does not have this. The firstdefault-src: 'none'
is added by VSCode.)Desktop (please complete the following information):