Skip to content

Commit

Permalink
[OneBot] fix failure to parse fileurl with URL encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkRRb committed Feb 29, 2024
1 parent 5412003 commit 2cf0052
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lagrange.OneBot/Message/Entity/CommonResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class CommonResolver
return uri.Scheme switch
{
"http" or "https" => Client.GetAsync(uri).Result.Content.ReadAsByteArrayAsync().Result,
"file" => File.ReadAllBytes(Path.GetFullPath(uri.AbsolutePath)),
"file" => File.ReadAllBytes(Path.GetFullPath(uri.LocalPath)),
_ => null,
};
}
Expand All @@ -27,7 +27,7 @@ public static class CommonResolver
return uri.Scheme switch
{
"http" or "https" => Client.GetAsync(uri).Result.Content.ReadAsStreamAsync().Result,
"file" => new FileStream(Path.GetFullPath(uri.AbsolutePath), FileMode.Open),
"file" => new FileStream(Path.GetFullPath(uri.LocalPath), FileMode.Open),
_ => null,
};
}
Expand Down

0 comments on commit 2cf0052

Please sign in to comment.