From 1a2eb7f8952b3229d9d124b3ecd612fa65d25a12 Mon Sep 17 00:00:00 2001 From: RingLo_ Date: Wed, 4 Sep 2024 18:52:59 +0800 Subject: [PATCH 1/2] fix: `package.json` has wrong url --- VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs b/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs index d5b5b8d..ee84628 100644 --- a/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs +++ b/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs @@ -3,6 +3,7 @@ using AutoMapper; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.OutputCaching; +using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Options; using Semver; using VPMReposSynchronizer.Core.Models.Entity; @@ -134,8 +135,8 @@ private VpmPackage GetPackageWithUrl(VpmPackageEntity package) var vpmPackage = mapper.Map(package); var fileDownloadEndpoint = new Uri(fileHostOptions.Value.BaseUrl, - $"files/{package.FileId}/download/{package.PackageId}.zip").ToString(); - vpmPackage.Url = fileDownloadEndpoint; + $"files/download/{package.PackageId}.zip").ToString(); + vpmPackage.Url = QueryHelpers.AddQueryString(fileDownloadEndpoint, "fileId", package.FileId); ; return vpmPackage; } From 478a86138c814cd73d4fbcce7040d1298fac63b1 Mon Sep 17 00:00:00 2001 From: RingLo_ Date: Wed, 4 Sep 2024 19:04:12 +0800 Subject: [PATCH 2/2] fix: repeated semicolon --- VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs b/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs index ee84628..5fb8e1b 100644 --- a/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs +++ b/VPMReposSynchronizer.Entry/Controllers/VpmRepoController.cs @@ -136,7 +136,7 @@ private VpmPackage GetPackageWithUrl(VpmPackageEntity package) var fileDownloadEndpoint = new Uri(fileHostOptions.Value.BaseUrl, $"files/download/{package.PackageId}.zip").ToString(); - vpmPackage.Url = QueryHelpers.AddQueryString(fileDownloadEndpoint, "fileId", package.FileId); ; + vpmPackage.Url = QueryHelpers.AddQueryString(fileDownloadEndpoint, "fileId", package.FileId); return vpmPackage; }