Skip to content

Commit 1cc7c73

Browse files
committed
chore: makes the fix specific to non-windows
Signed-off-by: Vincent Biret <[email protected]>
1 parent df99a00 commit 1cc7c73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using System.IO;
66
using System.Net.Http;
7+
using System.Runtime.InteropServices;
78
using System.Threading;
89
using System.Threading.Tasks;
910
using Microsoft.OpenApi.Interfaces;
@@ -35,7 +36,7 @@ public async Task<Stream> LoadAsync(Uri uri, CancellationToken cancellationToken
3536
{
3637
(true, _, _) => new Uri(Path.Combine(Directory.GetCurrentDirectory(), uri.ToString())),
3738
// this overcomes a URI concatenation issue for local paths on linux OSes
38-
(_, true, false) when baseUrl.Scheme.Equals("file", StringComparison.OrdinalIgnoreCase) =>
39+
(_, true, false) when baseUrl.Scheme.Equals("file", StringComparison.OrdinalIgnoreCase) && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows) =>
3940
new Uri(Path.Combine(baseUrl.AbsoluteUri, uri.ToString())),
4041
(_, _, _) => new Uri(baseUrl, uri),
4142
};

0 commit comments

Comments
 (0)