Skip to content

Commit 451b51f

Browse files
committed
Try to fix error
1 parent bfbcdf3 commit 451b51f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Rewrite/src/Rewrite.Server/Server.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.CodeAnalysis;
66
using Microsoft.Extensions.Hosting;
77
using Microsoft.Extensions.Logging;
8+
using NMica.Utils.IO;
89
using NuGet.Configuration;
910
using NuGet.LibraryModel;
1011
using NuGet.Versioning;
@@ -103,7 +104,7 @@ private async Task InstallRecipe(NetworkStream stream, RemotingContext context,
103104
var sources = CBORObject.Read(stream).Values.Select(rawSource =>
104105
{
105106

106-
var source = Regex.Replace(rawSource["source"].AsString(), @"file:\/+", "");
107+
var source = Regex.Replace(rawSource["source"].AsString(), @"^file:(/(?=[a-zA-Z]:)|(?=/))", "");
107108
var packageSource = new PackageSource(source);
108109

109110
var rawCredential = rawSource["credential"];
@@ -117,6 +118,7 @@ private async Task InstallRecipe(NetworkStream stream, RemotingContext context,
117118

118119
return packageSource;
119120
}).ToList();
121+
CBORObject.Read(stream); // command end
120122

121123
var requestDetails = new
122124
{

0 commit comments

Comments
 (0)