Fix the same previous issue in other plugins
Some checks failed
MSBuild / build (push) Has been cancelled
MSBuild / publish (push) Has been cancelled

This commit is contained in:
ema
2025-08-15 02:17:50 +08:00
parent ebb48366a0
commit 21a3dd3d4b
10 changed files with 20 additions and 20 deletions

View File

@@ -27,7 +27,7 @@ internal static class LottieExtractor
{
public static string GetJsonContent(string path)
{
using var fileStream = File.OpenRead(path);
using var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
using var zipArchive = new ZipArchive(fileStream, ZipArchiveMode.Read);
var manifestEntry = zipArchive.GetEntry("manifest.json");

View File

@@ -130,11 +130,11 @@ public class SvgImagePanel : WebpagePanel, IWebImagePanel
}
else
{
var localPath = _fallbackPath + requestedUri.AbsolutePath.Replace('/', '\\');
var localPath = _fallbackPath + Uri.UnescapeDataString(requestedUri.AbsolutePath).Replace('/', '\\');
if (File.Exists(localPath))
{
var fileStream = File.OpenRead(localPath);
var fileStream = new FileStream(localPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
var response = _webView.CoreWebView2.Environment.CreateWebResourceResponse(
fileStream, 200, "OK", MimeTypes.GetContentTypeHeader());
args.Response = response;
@@ -149,7 +149,7 @@ public class SvgImagePanel : WebpagePanel, IWebImagePanel
{
if (File.Exists(localPath))
{
var fileStream = File.OpenRead(localPath);
var fileStream = new FileStream(localPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
var response = _webView.CoreWebView2.Environment.CreateWebResourceResponse(
fileStream, 200, "OK",
$"""