Skip to content

Commit 6dded81

Browse files
authored
Merge pull request #2484 from jkporter/main
fix: file access for "file" URI scheme with special characters
2 parents 171cf91 + deb0268 commit 6dded81

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)