Support svg in downloadImage()

This commit is contained in:
Yang Luo
2023-07-31 20:23:28 +08:00
parent d7b2bcf288
commit c6f301ff9e

View File

@ -69,6 +69,8 @@ func downloadImage(client *http.Client, url string) (*bytes.Buffer, string, erro
fileExtension = ".ico" fileExtension = ".ico"
case "image/x-icon": case "image/x-icon":
fileExtension = ".ico" fileExtension = ".ico"
case "image/svg+xml":
fileExtension = ".svg"
default: default:
return nil, "", fmt.Errorf("unsupported content type: %s", contentType) return nil, "", fmt.Errorf("unsupported content type: %s", contentType)
} }