Skip to content

Commit deb0268

Browse files
committed
Fix file access for "file" URI scheme
Updated the file access method to use `absoluteUri.LocalPath` instead of `absoluteUri.AbsolutePath` when the URI scheme is "file". This change ensures correct file opening for local files.
1 parent 171cf91 commit deb0268

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.OpenApi/Reader/Services/DefaultStreamLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task<Stream> LoadAsync(Uri baseUrl, Uri uri, CancellationToken canc
3636

3737
return absoluteUri.Scheme switch
3838
{
39-
"file" => File.OpenRead(absoluteUri.AbsolutePath),
39+
"file" => File.OpenRead(absoluteUri.LocalPath),
4040
"http" or "https" =>
4141
#if NET5_0_OR_GREATER
4242
await _httpClient.GetStreamAsync(absoluteUri, cancellationToken).ConfigureAwait(false),

0 commit comments

Comments
 (0)