From d11e7c04e1487dee4ce8478f952763e5e5d6c44f Mon Sep 17 00:00:00 2001 From: doxoh Date: Thu, 29 Feb 2024 17:49:32 +0100 Subject: [PATCH] fix(client): final fix load nugets --- client/src/coreclr/CoreClrValidation.cpp | 2 +- client/src/nuget/NuGet.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/coreclr/CoreClrValidation.cpp b/client/src/coreclr/CoreClrValidation.cpp index cca2268..23e4c8b 100644 --- a/client/src/coreclr/CoreClrValidation.cpp +++ b/client/src/coreclr/CoreClrValidation.cpp @@ -28,7 +28,7 @@ std::string CoreClr::GetLatestNugetVersion(alt::IHttpClient* httpClient, const s if (branch == "release") { if (it->find("-") == std::string::npos) return *it; } else { - if (it->find("-" + branch) != std::string::npos) return *it; + if (it->find("-" + branch + ".") != std::string::npos) return *it; } } diff --git a/client/src/nuget/NuGet.cpp b/client/src/nuget/NuGet.cpp index 62e36ff..e79b05d 100644 --- a/client/src/nuget/NuGet.cpp +++ b/client/src/nuget/NuGet.cpp @@ -32,8 +32,8 @@ std::vector NuGet::GetPackageVersions(const std::string& package) { nlohmann::json NuGet::GetCatalog(std::string package, const std::string& version) { utils::to_lower(package); - - static std::string url = GetIndexUrl("RegistrationsBaseUrl"); + + static std::string url = GetIndexUrl("RegistrationsBaseUrl/3.6.0"); auto data = utils::download_file_sync(_httpClient, url + package + "/" + version + ".json"); if (data.statusCode != 200) { throw std::runtime_error("Failed to get package " + package + " registration"); @@ -48,7 +48,7 @@ nlohmann::json NuGet::GetCatalog(std::string package, const std::string& version std::string NuGet::DownloadPackage(std::string package, const std::string& version) { utils::to_lower(package); - + static std::string url = GetIndexUrl("PackageBaseAddress/3.0.0"); auto data = utils::download_file_sync(_httpClient, url + package + "/" + version + "/" + package + "." + version + ".nupkg"); if (data.statusCode != 200) {