Skip to content

Commit 50ba9fc

Browse files
committed
fix: disable svg in data:image urls
1 parent 2326684 commit 50ba9fc

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎renderer/html/html.go‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,6 @@ var bPng = []byte("png;")
935935
var bGif = []byte("gif;")
936936
var bJpeg = []byte("jpeg;")
937937
var bWebp = []byte("webp;")
938-
var bSvg = []byte("svg+xml;")
939938
var bJs = []byte("javascript:")
940939
var bVb = []byte("vbscript:")
941940
var bFile = []byte("file:")
@@ -951,8 +950,7 @@ func IsDangerousURL(url []byte) bool {
951950
if hasPrefix(url, bDataImage) && len(url) >= 11 {
952951
v := url[11:]
953952
if hasPrefix(v, bPng) || hasPrefix(v, bGif) ||
954-
hasPrefix(v, bJpeg) || hasPrefix(v, bWebp) ||
955-
hasPrefix(v, bSvg) {
953+
hasPrefix(v, bJpeg) || hasPrefix(v, bWebp) {
956954
return false
957955
}
958956
return true

0 commit comments

Comments
 (0)