fix(api): serve per-package analytics for names with slashes

The route matched one path segment, so scoped npm names and Go module
paths returned 404. It now takes the rest of the path as the name.
This commit is contained in:
2026-11-24 00:49:27 +00:00
parent a511544d7a
commit b248bfed31
4 changed files with 23 additions and 4 deletions
+2 -1
View File
@@ -88,7 +88,8 @@ func (a *App) handleAnalyticsPackageStats(c fiber.Ctx) error {
c.Set("Content-Type", "application/json")
registry := c.Params("registry")
name := c.Params("name")
// The wildcard route carries names with slashes (@scope/pkg, Go module paths).
name := c.Params("*")
if registry == "" || name == "" {
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{