diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2023-02-11 12:30:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 19:30:44 +0800 |
commit | 9057a008a1019144611aa9e3fd53a5e3a404c389 (patch) | |
tree | d4a3dd87ec8dfb6c734d5f846fa2f816a33a26b9 /routers/api/packages/api.go | |
parent | fb1a2a13f05665764a6f91ed1a421b9e93c4e8c9 (diff) | |
download | gitea-9057a008a1019144611aa9e3fd53a5e3a404c389.tar.gz gitea-9057a008a1019144611aa9e3fd53a5e3a404c389.zip |
Add `/$count` endpoints for NuGet v2 (#22855)
Fixes #22838
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/api/packages/api.go')
-rw-r--r-- | routers/api/packages/api.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/routers/api/packages/api.go b/routers/api/packages/api.go index 9f77367d6f..0e3d8b7a02 100644 --- a/routers/api/packages/api.go +++ b/routers/api/packages/api.go @@ -286,9 +286,18 @@ func CommonRoutes(ctx gocontext.Context) *web.Route { }, reqPackageAccess(perm.AccessModeWrite)) r.Get("/symbols/{filename}/{guid:[0-9a-fA-F]{32}[fF]{8}}/{filename2}", nuget.DownloadSymbolFile) r.Get("/Packages(Id='{id:[^']+}',Version='{version:[^']+}')", nuget.RegistrationLeafV2) - r.Get("/Packages()", nuget.SearchServiceV2) - r.Get("/FindPackagesById()", nuget.EnumeratePackageVersionsV2) - r.Get("/Search()", nuget.SearchServiceV2) + r.Group("/Packages()", func() { + r.Get("", nuget.SearchServiceV2) + r.Get("/$count", nuget.SearchServiceV2Count) + }) + r.Group("/FindPackagesById()", func() { + r.Get("", nuget.EnumeratePackageVersionsV2) + r.Get("/$count", nuget.EnumeratePackageVersionsV2Count) + }) + r.Group("/Search()", func() { + r.Get("", nuget.SearchServiceV2) + r.Get("/$count", nuget.SearchServiceV2Count) + }) }, reqPackageAccess(perm.AccessModeRead)) }) r.Group("/npm", func() { |