From 517d986d067db95855eab549ffaf24126ba08cdc Mon Sep 17 00:00:00 2001 From: Teodora Sandu Date: Thu, 27 Jun 2024 14:54:40 +0100 Subject: [PATCH] fix: still support old vscode webview --- infrastructure/oss/template/details.html | 14 ++++++++------ internal/html/html.go | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/infrastructure/oss/template/details.html b/infrastructure/oss/template/details.html index 86624d16a..25e8ef2ad 100644 --- a/infrastructure/oss/template/details.html +++ b/infrastructure/oss/template/details.html @@ -20,7 +20,7 @@ + content="default-src 'self' ${cspSource}; style-src 'self' 'nonce-${nonce}' ${cspSource}; script-src 'nonce-${nonce}' ${cspSource};"> + ${headerEnd} + ${ideStyle} @@ -110,7 +112,7 @@
{{.IssueType}} {{if gt (len .CVEs) 0}} - | + {{range $index, $cve := .CVEs}} {{$cve}} @@ -119,7 +121,7 @@ {{end}} {{if gt (len .CWEs) 0}} - | + {{range $index, $cwe := .CWEs}} {{$cwe}} @@ -128,11 +130,11 @@ {{end}} {{if gt (len .CVSSv4) 0}} - | - {{.CVSSv4}} + + CVSS {{.CVSSv4}} {{end}} - | + {{.IssueId}}
diff --git a/internal/html/html.go b/internal/html/html.go index b5f7b1c1d..082330f24 100644 --- a/internal/html/html.go +++ b/internal/html/html.go @@ -37,7 +37,7 @@ func TrimCWEPrefix(cwe string) string { } func GetLessonIconSvg() template.HTML { - return template.HTML(` + return template.HTML(` `) @@ -46,22 +46,22 @@ func GetLessonIconSvg() template.HTML { func GetSeverityIconSvg(issue snyk.Issue) template.HTML { switch issue.Severity { case snyk.Critical: - return template.HTML(` + return template.HTML(` `) case snyk.High: - return template.HTML(` + return template.HTML(` `) case snyk.Medium: - return template.HTML(` + return template.HTML(` `) case snyk.Low: - return template.HTML(` + return template.HTML(` `)